<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
           "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>Coverage Report</title>
<link title="Style" type="text/css" rel="stylesheet" href="css/main.css"/>
<script type="text/javascript" src="js/popup.js"></script>
</head>
<body>
<h5>Coverage Report - org.sakaiproject.genericdao.springjdbc.JdbcGenericDao</h5>
<div class="separator">&nbsp;</div>
<table class="report">
<thead><tr>  <td class="heading">Classes in this File</td>  <td class="heading" width="20%"><a class="dfn" href="help.html" onclick="popupwindow('help.html'); return false;">Line Coverage</a></td>  <td class="heading" width="20%"><a class="dfn" href="help.html" onclick="popupwindow('help.html'); return false;">Branch Coverage</a></td>  <td class="heading" width="10%"><a class="dfn" href="help.html" onclick="popupwindow('help.html'); return false;">Complexity</a></td></tr></thead>
  <tr><td class="text"><a href="org.sakaiproject.genericdao.springjdbc.JdbcGenericDao.html">JdbcGenericDao</a></td><td class="value"><table cellpadding="0" cellspacing="0" align="right"><tr><td>72%&nbsp;</td><td><table class="percentGraph" cellpadding="0" cellspacing="0" width="100"><tr><td class="covered" width="71"></td><td class="uncovered" width="28"></td></tr></table></td></tr></table></td><td class="value"><table cellpadding="0" cellspacing="0" align="right"><tr><td>88%&nbsp;</td><td><table class="percentGraph" cellpadding="0" cellspacing="0" width="100"><tr><td class="covered" width="88"></td><td class="uncovered" width="11"></td></tr></table></td></tr></table></td><td class="value"><span class="hidden">0.0;</span>0</td></tr>
</table>
<div class="separator">&nbsp;</div>
<table cellspacing="0" cellpadding="0" class="src">
<tr>
  <td class="numLine">&nbsp;1</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;2</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> * $Id: org.sakaiproject.genericdao.springjdbc.JdbcGenericDao.html 11 2009-01-29 14:58:33Z azeckoski $</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;3</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> * $URL: http://genericdao.googlecode.com/svn/maven/site/cobertura/org.sakaiproject.genericdao.springjdbc.JdbcGenericDao.html $</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;4</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> * JdbcGenericDao.java - genericdao - Apr 18, 2008 10:07:08 AM - azeckoski</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;5</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> **************************************************************************</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;6</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> * Copyright (c) 2008 Aaron Zeckoski</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;7</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> * Licensed under the Apache License, Version 2</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;8</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> * </span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;9</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> * A copy of the Apache License, Version 2 has been included in this </span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;10</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> * distribution and is available at: http://www.apache.org/licenses/LICENSE-2.0.txt</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;11</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> *</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;12</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> * Aaron Zeckoski (azeckoski@gmail.com) (aaronz@vt.edu) (aaron@caret.cam.ac.uk)</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;13</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> */</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;14</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;15</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">package</span> org.sakaiproject.genericdao.springjdbc;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;16</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;17</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.io.BufferedReader;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;18</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.io.ByteArrayInputStream;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;19</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.io.IOException;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;20</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.io.InputStream;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;21</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.io.InputStreamReader;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;22</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.io.Serializable;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;23</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.lang.annotation.Annotation;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;24</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.sql.Connection;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;25</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.sql.SQLException;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;26</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.util.ArrayList;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;27</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.util.HashMap;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;28</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.util.Iterator;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;29</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.util.List;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;30</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.util.Map;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;31</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.util.Vector;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;32</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.util.Map.Entry;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;33</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.util.concurrent.ConcurrentHashMap;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;34</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;35</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> javax.sql.DataSource;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;36</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;37</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.azeckoski.reflectutils.ArrayUtils;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;38</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.azeckoski.reflectutils.ClassFields;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;39</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.azeckoski.reflectutils.ReflectUtils;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;40</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.azeckoski.reflectutils.ClassFields.FieldsFilter;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;41</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.azeckoski.reflectutils.exceptions.FieldnameNotFoundException;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;42</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;<span class="keyword">import</span> org.sakaiproject.genericdao.api.GenericDao;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;43</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.sakaiproject.genericdao.api.annotations.PersistentColumnMappingPolicy;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;44</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.sakaiproject.genericdao.api.annotations.PersistentColumnName;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;45</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.sakaiproject.genericdao.api.annotations.PersistentId;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;46</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.sakaiproject.genericdao.api.annotations.PersistentTransient;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;47</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.sakaiproject.genericdao.api.annotations.enums.MappingPolicy;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;48</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.sakaiproject.genericdao.api.caching.CacheProvider;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;49</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.sakaiproject.genericdao.api.interceptors.DaoOperationInterceptor;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;50</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.sakaiproject.genericdao.api.interceptors.ReadInterceptor;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;51</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.sakaiproject.genericdao.api.interceptors.WriteInterceptor;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;52</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.sakaiproject.genericdao.api.mappers.DataMapper;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;53</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.sakaiproject.genericdao.api.mappers.EntityColumnMapper;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;54</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.sakaiproject.genericdao.api.mappers.NamesRecord;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;55</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.sakaiproject.genericdao.api.mappers.StatementMapper;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;56</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.sakaiproject.genericdao.api.search.Search;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;57</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.sakaiproject.genericdao.api.translators.DatabaseTranslator;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;58</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.sakaiproject.genericdao.base.caching.NonCachingCacheProvider;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;59</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.sakaiproject.genericdao.springjdbc.translators.BasicTranslator;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;60</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.sakaiproject.genericdao.springjdbc.translators.DB2Translator;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;61</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.sakaiproject.genericdao.springjdbc.translators.DerbyTranslator;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;62</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.sakaiproject.genericdao.springjdbc.translators.HSQLDBTranslator;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;63</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.sakaiproject.genericdao.springjdbc.translators.MSSQLTranslator;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;64</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.sakaiproject.genericdao.springjdbc.translators.MySQLTranslator;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;65</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.sakaiproject.genericdao.springjdbc.translators.OracleTranslator;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;66</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.sakaiproject.genericdao.springjdbc.translators.PostgresTranslator;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;67</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.sakaiproject.genericdao.springutil.SmartDataSourceWrapper;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;68</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.sakaiproject.genericdao.util.JDBCUtils;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;69</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.sakaiproject.genericdao.util.ThreadboundConnectionsDataSourceWrapper;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;70</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;71</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.springframework.dao.DataAccessException;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;72</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.springframework.dao.IncorrectResultSizeDataAccessException;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;73</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.springframework.jdbc.CannotGetJdbcConnectionException;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;74</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.springframework.jdbc.core.JdbcTemplate;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;75</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.springframework.jdbc.core.support.JdbcDaoSupport;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;76</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.springframework.jdbc.datasource.DataSourceUtils;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;77</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> org.springframework.jdbc.datasource.SmartDataSource;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;78</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;79</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;80</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> * A Spring JDBC (http://hibernate.org/) based implementation of GenericDao</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;81</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> * which can be extended to add more specialized DAO methods.</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;82</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> * &lt;p&gt;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;83</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> * Note: This implementation is so simple it is unlikely to be useful</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;84</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> * &lt;p&gt;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;85</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> * See the overview for installation/usage tips.</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;86</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> * </span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;87</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> * @author Aaron Zeckoski (azeckoski@gmail.com)</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;88</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment"> */</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;89</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">public</span> <span class="keyword">class</span> JdbcGenericDao <span class="keyword">extends</span> JdbcDaoSupport <span class="keyword">implements</span> GenericDao {</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;90</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;91</td>
  <td class="nbHitsCovered">&nbsp;18</td>
  <td class="src"><pre class="src">&nbsp;    <span class="keyword">private</span> String databaseType = DataMapper.DBTYPE_HSQLDB;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;92</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;93</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * This should be set to the type of database being used</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;94</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * and determines which DDL to run when creating the tables,</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;95</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * defaults to {@link DataMapper#DBTYPE_HSQLDB} "HSQLDB",</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;96</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * will fixup case as needed</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;97</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;98</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    <span class="keyword">public</span> <span class="keyword">void</span> setDatabaseType(String databaseType) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;99</td>
  <td class="nbHitsCovered">&nbsp;8</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (databaseType == <span class="keyword">null</span> || databaseType.length() == 0) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;100</td>
  <td class="nbHitsCovered">&nbsp;1</td>
  <td class="src"><pre class="src">&nbsp;            <span class="keyword">throw</span> <span class="keyword">new</span> IllegalArgumentException(<span class="string">"databaseType cannot be null or empty"</span>);</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;101</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;102</td>
  <td class="nbHitsCovered">&nbsp;7</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (DatabaseTranslator.DBTYPE_DB2.equalsIgnoreCase(databaseType)) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;103</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            <span class="keyword">this</span>.databaseType = DatabaseTranslator.DBTYPE_DB2;</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;104</td>
  <td class="nbHitsCovered">&nbsp;7</td>
  <td class="src"><pre class="src">&nbsp;        } <span class="keyword">else</span> <span class="keyword">if</span> (DatabaseTranslator.DBTYPE_DERBY.equalsIgnoreCase(databaseType)) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;105</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            <span class="keyword">this</span>.databaseType = DatabaseTranslator.DBTYPE_DERBY;</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;106</td>
  <td class="nbHitsCovered">&nbsp;7</td>
  <td class="src"><pre class="src">&nbsp;        } <span class="keyword">else</span> <span class="keyword">if</span> (DatabaseTranslator.DBTYPE_HSQLDB.equalsIgnoreCase(databaseType)) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;107</td>
  <td class="nbHitsCovered">&nbsp;4</td>
  <td class="src"><pre class="src">&nbsp;            <span class="keyword">this</span>.databaseType = DatabaseTranslator.DBTYPE_HSQLDB;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;108</td>
  <td class="nbHitsCovered">&nbsp;3</td>
  <td class="src"><pre class="src">&nbsp;        } <span class="keyword">else</span> <span class="keyword">if</span> (DatabaseTranslator.DBTYPE_MSSQL.equalsIgnoreCase(databaseType)) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;109</td>
  <td class="nbHitsCovered">&nbsp;1</td>
  <td class="src"><pre class="src">&nbsp;            <span class="keyword">this</span>.databaseType = DatabaseTranslator.DBTYPE_MSSQL;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;110</td>
  <td class="nbHitsCovered">&nbsp;2</td>
  <td class="src"><pre class="src">&nbsp;        } <span class="keyword">else</span> <span class="keyword">if</span> (DatabaseTranslator.DBTYPE_MYSQL.equalsIgnoreCase(databaseType)) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;111</td>
  <td class="nbHitsCovered">&nbsp;1</td>
  <td class="src"><pre class="src">&nbsp;            <span class="keyword">this</span>.databaseType = DatabaseTranslator.DBTYPE_MYSQL;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;112</td>
  <td class="nbHitsCovered">&nbsp;1</td>
  <td class="src"><pre class="src">&nbsp;        } <span class="keyword">else</span> <span class="keyword">if</span> (DatabaseTranslator.DBTYPE_ORACLE.equalsIgnoreCase(databaseType)) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;113</td>
  <td class="nbHitsCovered">&nbsp;1</td>
  <td class="src"><pre class="src">&nbsp;            <span class="keyword">this</span>.databaseType = DatabaseTranslator.DBTYPE_ORACLE;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;114</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;        } <span class="keyword">else</span> <span class="keyword">if</span> (DatabaseTranslator.DBTYPE_POSTGRES.equalsIgnoreCase(databaseType)) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;115</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            <span class="keyword">this</span>.databaseType = DatabaseTranslator.DBTYPE_POSTGRES;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;116</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        } <span class="keyword">else</span> {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;117</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            <span class="keyword">this</span>.databaseType = databaseType.toUpperCase();</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;118</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;119</td>
  <td class="nbHitsCovered">&nbsp;7</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;120</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;121</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @return a constant indicating the type of database: DBTYPE_*</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;122</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;123</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    <span class="keyword">protected</span> String getDatabaseType() {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;124</td>
  <td class="nbHitsCovered">&nbsp;203</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> databaseType;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;125</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;126</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;127</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;128</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @return the jdbcTemplate that is currently in use,</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;129</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * allows for overriding and support DAO-4 (http://jira.sakaiproject.org/jira/browse/DAO-4)</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;130</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;131</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    <span class="keyword">public</span> JdbcTemplate getSpringJdbcTemplate() {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;132</td>
  <td class="nbHitsCovered">&nbsp;2476</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> <span class="keyword">super</span>.getJdbcTemplate();</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;133</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;134</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;135</td>
  <td class="nbHitsCovered">&nbsp;18</td>
  <td class="src"><pre class="src">&nbsp;    <span class="keyword">protected</span> <span class="keyword">boolean</span> showSQL = <span class="keyword">false</span>;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;136</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;137</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * Enable SQL debugging which will show all SQL statements and DDL statements being executed by printing them out</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;138</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * </span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;139</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param showSQL if true then all SQL and DDL statements will be printed</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;140</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;141</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    <span class="keyword">public</span> <span class="keyword">void</span> setShowSQL(<span class="keyword">boolean</span> showSQL) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;142</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;        <span class="keyword">this</span>.showSQL = showSQL;</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;143</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    }</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;144</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;145</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @return true if show SQL is enabled, not a good idea for production</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;146</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;147</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    <span class="keyword">public</span> <span class="keyword">boolean</span> isShowSQL() {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;148</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;        <span class="keyword">return</span> showSQL;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;149</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;150</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;151</td>
  <td class="nbHitsCovered">&nbsp;18</td>
  <td class="src"><pre class="src">&nbsp;    <span class="keyword">private</span> <span class="keyword">boolean</span> autoDDL = <span class="keyword">true</span>;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;152</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;153</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @return true if automatic DDL execution is enabled</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;154</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;155</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    <span class="keyword">public</span> <span class="keyword">boolean</span> isAutoDDL() {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;156</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;        <span class="keyword">return</span> autoDDL;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;157</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;158</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;159</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * Set to true to cause defined DDL to be executed</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;160</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * </span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;161</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param autoDDL set to true to cause the DDL to be executed,</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;162</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * if false then no DDL will be executed</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;163</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;164</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    <span class="keyword">public</span> <span class="keyword">void</span> setAutoDDL(<span class="keyword">boolean</span> autoDDL) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;165</td>
  <td class="nbHitsCovered">&nbsp;4</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">this</span>.autoDDL = autoDDL;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;166</td>
  <td class="nbHitsCovered">&nbsp;4</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;167</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;168</td>
  <td class="nbHitsCovered">&nbsp;18</td>
  <td class="src"><pre class="src">&nbsp;    <span class="keyword">private</span> <span class="keyword">boolean</span> autoCommitDDL = <span class="keyword">false</span>;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;169</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;170</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @return true if DDL automatic commits are enabled</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;171</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;172</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    <span class="keyword">public</span> <span class="keyword">boolean</span> isAutoCommitDDL() {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;173</td>
  <td class="nbHitsCovered">&nbsp;50</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> autoCommitDDL;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;174</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;175</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;176</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * Allows control over whether the DDL should be committed after each statement as it is read in,</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;177</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * this should probably be disabled if you are using a transaction manager and should be enabled if</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;178</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * you are managing your own transactions</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;179</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * </span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;180</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param autoCommitDDL true to enable auto commits on DDL excecution</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;181</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;182</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    <span class="keyword">public</span> <span class="keyword">void</span> setAutoCommitDDL(<span class="keyword">boolean</span> autoCommitDDL) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;183</td>
  <td class="nbHitsCovered">&nbsp;3</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">this</span>.autoCommitDDL = autoCommitDDL;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;184</td>
  <td class="nbHitsCovered">&nbsp;3</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;185</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;186</td>
  <td class="nbHitsCovered">&nbsp;18</td>
  <td class="src"><pre class="src">&nbsp;    <span class="keyword">private</span> <span class="keyword">boolean</span> autoCommitOperations = <span class="keyword">false</span>;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;187</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;188</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @return true if automatic commit is enabled for all generic DAO write operations</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;189</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;190</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    <span class="keyword">public</span> <span class="keyword">boolean</span> isAutoCommitOperations() {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;191</td>
  <td class="nbHitsCovered">&nbsp;2075</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> autoCommitOperations;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;192</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;193</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;194</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * Allows control over whether the DAO should do automatic commits for all generic DAO write operations</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;195</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * </span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;196</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param autoCommitOperations true to enable automatic commits for all generic dao operations,</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;197</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * this should be false if you are using a transaction manager</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;198</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;199</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    <span class="keyword">public</span> <span class="keyword">void</span> setAutoCommitOperations(<span class="keyword">boolean</span> autoCommitOperations) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;200</td>
  <td class="nbHitsCovered">&nbsp;3</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">this</span>.autoCommitOperations = autoCommitOperations;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;201</td>
  <td class="nbHitsCovered">&nbsp;3</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;202</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;203</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;204</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * This is a special case DataSource setter method which will wrap the DataSource,</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;205</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * you must use this in the case where the {@link DataSource} you are using is not</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;206</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * a Spring controlled on {@link SmartDataSource}, this will wrap the spring</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;207</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * DataSource automatically so that the auto-commit and manual transactions will work,</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;208</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * without this wrapper your connections will be closed after each jdbcTemplate method runs</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;209</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * and nothing will ever be committed (unless the connection is set to auto-commit) &lt;br/&gt;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;210</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * WARNING: if you use this then you are responsible for committing TXs and closing your connections </span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;211</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * using the {@link #closeConnection()} and {@link #commitTransaction()} or {@link #rollbackTransaction()}</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;212</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * methods &lt;br/&gt;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;213</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * Is not thread-bound</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;214</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @see #setNonSpringDataSource(DataSource, boolean)</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;215</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * </span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;216</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param dataSource any non-spring {@link DataSource}</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;217</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;218</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    <span class="keyword">public</span> <span class="keyword">void</span> setNonSpringDataSource(DataSource dataSource) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;219</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;        setNonSpringDataSource(dataSource, <span class="keyword">false</span>);</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;220</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    }</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;221</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;222</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;223</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * This is a special case DataSource setter method which will wrap the DataSource,</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;224</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * you must use this in the case where the {@link DataSource} you are using is not</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;225</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * a Spring controlled on {@link SmartDataSource}, this will wrap the spring</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;226</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * DataSource automatically so that the auto-commit and manual transactions will work,</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;227</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * without this wrapper your connections will be closed after each jdbcTemplate method runs</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;228</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * and nothing will ever be committed (unless the connection is set to auto-commit) &lt;br/&gt;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;229</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * WARNING: if you use this then you are responsible for committing TXs and closing your connections </span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;230</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * using the {@link #closeConnection()} and {@link #commitTransaction()} or {@link #rollbackTransaction()}</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;231</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * methods</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;232</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * </span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;233</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param dataSource any non-spring {@link DataSource}</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;234</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param threadBound if true then the connections will be thread-bound and only one returned</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;235</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * for the current thread no matter how many times getConnection is called, </span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;236</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * if false then they will return a new connection for each call</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;237</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;238</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    <span class="keyword">public</span> <span class="keyword">void</span> setNonSpringDataSource(DataSource dataSource, <span class="keyword">boolean</span> threadBound) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;239</td>
  <td class="nbHitsCovered">&nbsp;1</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (dataSource == <span class="keyword">null</span>) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;240</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            <span class="keyword">throw</span> <span class="keyword">new</span> IllegalArgumentException(<span class="string">"dataSource cannot be null"</span>);</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;241</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;242</td>
  <td class="nbHitsCovered">&nbsp;1</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (dataSource <span class="keyword">instanceof</span> SmartDataSource) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;243</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            setDataSource(dataSource);</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;244</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        } <span class="keyword">else</span> {</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;245</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            <span class="comment">// wrap it up</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;246</td>
  <td class="nbHitsCovered">&nbsp;1</td>
  <td class="src"><pre class="src">&nbsp;            DataSource wrapper = dataSource;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;247</td>
  <td class="nbHitsCovered">&nbsp;1</td>
  <td class="src"><pre class="src">&nbsp;            <span class="keyword">if</span> (threadBound) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;248</td>
  <td class="nbHitsCovered">&nbsp;1</td>
  <td class="src"><pre class="src">&nbsp;                wrapper = <span class="keyword">new</span> ThreadboundConnectionsDataSourceWrapper(wrapper);</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;249</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;250</td>
  <td class="nbHitsCovered">&nbsp;1</td>
  <td class="src"><pre class="src">&nbsp;            wrapper = <span class="keyword">new</span> SmartDataSourceWrapper(wrapper);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;251</td>
  <td class="nbHitsCovered">&nbsp;1</td>
  <td class="src"><pre class="src">&nbsp;            setDataSource( wrapper );</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;252</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;253</td>
  <td class="nbHitsCovered">&nbsp;1</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;254</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;255</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;256</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;257</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * preserve the order the classes are read in, </span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;258</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * presumably this is also the dependency order </span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;259</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;260</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="keyword">private</span> Map&lt;Class&lt;?&gt;, DataMapper&gt; dataMappers;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;261</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;262</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * This tells the DAO about your persistent classes and their associated tables,</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;263</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * it is the major configuration path for the DAO</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;264</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param dataMappers a list of all {@link DataMapper}s that this DAO uses,</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;265</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * ideally this is no more than a few per DAO but it should include all tables which are directly linked</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;266</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;267</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    <span class="keyword">public</span> <span class="keyword">void</span> setDataMappers(List&lt;DataMapper&gt; dataMappers) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;268</td>
  <td class="nbHitsCovered">&nbsp;18</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (<span class="keyword">this</span>.dataMappers == <span class="keyword">null</span>) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;269</td>
  <td class="nbHitsCovered">&nbsp;18</td>
  <td class="src"><pre class="src">&nbsp;            <span class="keyword">this</span>.dataMappers = <span class="keyword">new</span> ConcurrentHashMap&lt;Class&lt;?&gt;, DataMapper&gt;();</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;270</td>
  <td class="nbHitsCovered">&nbsp;18</td>
  <td class="src"><pre class="src">&nbsp;            <span class="keyword">this</span>.classes = <span class="keyword">new</span> Vector&lt;Class&lt;?&gt;&gt;();</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;271</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;272</td>
  <td class="nbHitsCovered">&nbsp;18</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">for</span> (DataMapper dataMapper : dataMappers) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;273</td>
  <td class="nbHitsCovered">&nbsp;34</td>
  <td class="src"><pre class="src">&nbsp;            Class&lt;?&gt; type = dataMapper.getPersistentType();</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;274</td>
  <td class="nbHitsCovered">&nbsp;34</td>
  <td class="src"><pre class="src">&nbsp;            <span class="keyword">this</span>.dataMappers.put(type, dataMapper);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;275</td>
  <td class="nbHitsCovered">&nbsp;34</td>
  <td class="src"><pre class="src">&nbsp;            <span class="keyword">this</span>.classes.add(type);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;276</td>
  <td class="nbHitsCovered">&nbsp;34</td>
  <td class="src"><pre class="src">&nbsp;            getNamesRecord(type); <span class="comment">// prime the names record</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;277</td>
  <td class="nbHitsCovered">&nbsp;34</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;278</td>
  <td class="nbHitsCovered">&nbsp;18</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;279</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;280</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;281</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * Get a data mapper for a specific class,</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;282</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * will always return a data mapper</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;283</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;284</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    <span class="keyword">protected</span> DataMapper getDataMapper(Class&lt;?&gt; type) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;285</td>
  <td class="nbHitsCovered">&nbsp;4359</td>
  <td class="src"><pre class="src">&nbsp;        DataMapper dm = dataMappers.get(type);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;286</td>
  <td class="nbHitsCovered">&nbsp;4359</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (dm == <span class="keyword">null</span> &amp;&amp; classes.contains(type)) {</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;287</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            <span class="comment">// make a Simple DM, this assumes the necessary tables already exist</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;288</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            dm = <span class="keyword">new</span> SimpleDataMapper(type);</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;289</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            dataMappers.put(type, dm); <span class="comment">// place it in the map</span></span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;290</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;291</td>
  <td class="nbHitsCovered">&nbsp;4359</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (dm == <span class="keyword">null</span>) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;292</td>
  <td class="nbHitsCovered">&nbsp;6</td>
  <td class="src"><pre class="src">&nbsp;            <span class="keyword">throw</span> <span class="keyword">new</span> IllegalArgumentException(<span class="string">"type is not a persistent class type: "</span> + type);</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;293</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;294</td>
  <td class="nbHitsCovered">&nbsp;4353</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> dm;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;295</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;296</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;297</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">// names mapping cache</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;298</td>
  <td class="nbHitsCovered">&nbsp;18</td>
  <td class="src"><pre class="src">&nbsp;    <span class="keyword">private</span> Map&lt;Class&lt;?&gt;, NamesRecord&gt; namesRecordsCache = <span class="keyword">new</span> ConcurrentHashMap&lt;Class&lt;?&gt;, NamesRecord&gt;();</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;299</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;300</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * Get a names mapping for a specific class type,</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;301</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * uses caching, will always return a mapping</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;302</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;303</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    <span class="keyword">public</span> NamesRecord getNamesRecord(Class&lt;?&gt; type) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;304</td>
  <td class="nbHitsCovered">&nbsp;8174</td>
  <td class="src"><pre class="src">&nbsp;        NamesRecord nr = namesRecordsCache.get(type);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;305</td>
  <td class="nbHitsCovered">&nbsp;8174</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (nr == <span class="keyword">null</span>) {</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;306</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            <span class="comment">// get a names record from the data mapper</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;307</td>
  <td class="nbHitsCovered">&nbsp;39</td>
  <td class="src"><pre class="src">&nbsp;            DataMapper dm = getDataMapper(type);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;308</td>
  <td class="nbHitsCovered">&nbsp;34</td>
  <td class="src"><pre class="src">&nbsp;            nr = dm.getPropertyToColumnNamesMapping();</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;309</td>
  <td class="nbHitsCovered">&nbsp;34</td>
  <td class="src"><pre class="src">&nbsp;            <span class="keyword">if</span> (nr != <span class="keyword">null</span>) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;310</td>
  <td class="nbHitsCovered">&nbsp;19</td>
  <td class="src"><pre class="src">&nbsp;                nr.setIdentifierProperty( findIdProperty(type) );</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;311</td>
  <td class="nbHitsCovered">&nbsp;19</td>
  <td class="src"><pre class="src">&nbsp;                <span class="keyword">if</span> (nr.getForeignKeyPropertyNames().isEmpty()) {</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;312</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                    <span class="comment">// check for foreign keys and add them (only complete fields though)</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;313</td>
  <td class="nbHitsCovered">&nbsp;18</td>
  <td class="src"><pre class="src">&nbsp;                    Map&lt;String, Class&lt;?&gt;&gt; types = ReflectUtils.getInstance().getFieldTypes(type, FieldsFilter.COMPLETE);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;314</td>
  <td class="nbHitsCovered">&nbsp;18</td>
  <td class="src"><pre class="src">&nbsp;                    <span class="keyword">for</span> (Entry&lt;String, Class&lt;?&gt;&gt; entry : types.entrySet()) {</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;315</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                        <span class="comment">// special handling for foreign keys identified by persistent types inside this object</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;316</td>
  <td class="nbHitsCovered">&nbsp;54</td>
  <td class="src"><pre class="src">&nbsp;                        String property = entry.getKey();</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;317</td>
  <td class="nbHitsCovered">&nbsp;54</td>
  <td class="src"><pre class="src">&nbsp;                        Class&lt;?&gt; pType = entry.getValue();</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;318</td>
  <td class="nbHitsCovered">&nbsp;54</td>
  <td class="src"><pre class="src">&nbsp;                        <span class="keyword">if</span> (getPersistentClasses().contains(pType)) {</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;319</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                            <span class="comment">// this is another persistent object so this must be a foreign key</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;320</td>
  <td class="nbHitsCovered">&nbsp;5</td>
  <td class="src"><pre class="src">&nbsp;                            String pId = findIdProperty(pType);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;321</td>
  <td class="nbHitsCovered">&nbsp;5</td>
  <td class="src"><pre class="src">&nbsp;                            String fkProp = property + <span class="string">"."</span> + pId;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;322</td>
  <td class="nbHitsCovered">&nbsp;5</td>
  <td class="src"><pre class="src">&nbsp;                            String column = nr.getColumnForProperty(property);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;323</td>
  <td class="nbHitsCovered">&nbsp;5</td>
  <td class="src"><pre class="src">&nbsp;                            <span class="keyword">if</span> (column != <span class="keyword">null</span>) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;324</td>
  <td class="nbHitsCovered">&nbsp;5</td>
  <td class="src"><pre class="src">&nbsp;                                nr.setForeignKeyMapping(fkProp, column);</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;325</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                            }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;326</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;327</td>
  <td class="nbHitsCovered">&nbsp;54</td>
  <td class="src"><pre class="src">&nbsp;                    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;328</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;329</td>
  <td class="nbHitsCovered">&nbsp;19</td>
  <td class="src"><pre class="src">&nbsp;                namesRecordsCache.put(type, nr);</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;330</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;331</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;332</td>
  <td class="nbHitsCovered">&nbsp;8169</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (nr == <span class="keyword">null</span>) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;333</td>
  <td class="nbHitsCovered">&nbsp;15</td>
  <td class="src"><pre class="src">&nbsp;            <span class="keyword">boolean</span> usePropertyNamesForColumns = <span class="keyword">false</span>;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;334</td>
  <td class="nbHitsCovered">&nbsp;15</td>
  <td class="src"><pre class="src">&nbsp;            DataMapper dm = getDataMapper(type);</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;335</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;336</td>
  <td class="nbHitsCovered">&nbsp;15</td>
  <td class="src"><pre class="src">&nbsp;            ReflectUtils reflectUtils = ReflectUtils.getInstance();</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;337</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            <span class="comment">// try to get the mapping from the class using annotations</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;338</td>
  <td class="nbHitsCovered">&nbsp;15</td>
  <td class="src"><pre class="src">&nbsp;            ClassFields&lt;?&gt; classFields = reflectUtils.analyzeClass(type);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;339</td>
  <td class="nbHitsCovered">&nbsp;15</td>
  <td class="src"><pre class="src">&nbsp;            <span class="keyword">if</span> (classFields.getClassAnnotations().contains(PersistentColumnMappingPolicy.<span class="keyword">class</span>)) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;340</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                <span class="keyword">for</span> (Annotation classAnnote : classFields.getClassAnnotations()) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;341</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                    <span class="keyword">if</span> (PersistentColumnMappingPolicy.<span class="keyword">class</span>.equals(classAnnote.annotationType())) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;342</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                        MappingPolicy mp = ((PersistentColumnMappingPolicy)classAnnote).policy();</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;343</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                        <span class="keyword">if</span> (MappingPolicy.FIELD_NAMES.equals(mp)) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;344</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                            usePropertyNamesForColumns = <span class="keyword">true</span>;</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;345</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                        } <span class="keyword">else</span> <span class="keyword">if</span> (MappingPolicy.UPPER_UNDERSCORES.equals(mp)) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;346</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                            usePropertyNamesForColumns = <span class="keyword">false</span>;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;347</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                        }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;348</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                    }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;349</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                    <span class="keyword">if</span> (dm <span class="keyword">instanceof</span> SimpleDataMapper) {</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;350</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                        <span class="comment">// override the setting</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;351</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                        ((SimpleDataMapper)dm).setUsePropertyNamesForColumns(usePropertyNamesForColumns);</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;352</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;353</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;354</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            } <span class="keyword">else</span> {</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;355</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                <span class="comment">// no annotation so get the setting from the data mapper</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;356</td>
  <td class="nbHitsCovered">&nbsp;15</td>
  <td class="src"><pre class="src">&nbsp;                <span class="keyword">if</span> (dm <span class="keyword">instanceof</span> SimpleDataMapper) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;357</td>
  <td class="nbHitsCovered">&nbsp;15</td>
  <td class="src"><pre class="src">&nbsp;                    usePropertyNamesForColumns = ((SimpleDataMapper)dm).isUsePropertyNamesForColumns();</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;358</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;359</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;360</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;361</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            <span class="comment">// create a names mapping using reflection</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;362</td>
  <td class="nbHitsCovered">&nbsp;15</td>
  <td class="src"><pre class="src">&nbsp;            nr = <span class="keyword">new</span> NamesRecord();</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;363</td>
  <td class="nbHitsCovered">&nbsp;15</td>
  <td class="src"><pre class="src">&nbsp;            Map&lt;String, Class&lt;?&gt;&gt; types = reflectUtils.getFieldTypes(type, FieldsFilter.COMPLETE);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;364</td>
  <td class="nbHitsCovered">&nbsp;15</td>
  <td class="src"><pre class="src">&nbsp;            <span class="keyword">for</span> (String property : types.keySet()) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;365</td>
  <td class="nbHitsCovered">&nbsp;45</td>
  <td class="src"><pre class="src">&nbsp;                String column = property;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;366</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                <span class="comment">// check for transient annotation</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;367</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                <span class="keyword">try</span> {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;368</td>
  <td class="nbHitsCovered">&nbsp;45</td>
  <td class="src"><pre class="src">&nbsp;                    Annotation annotation = classFields.getFieldAnnotation(PersistentTransient.<span class="keyword">class</span>, property);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;369</td>
  <td class="nbHitsCovered">&nbsp;45</td>
  <td class="src"><pre class="src">&nbsp;                    <span class="keyword">if</span> (annotation != <span class="keyword">null</span>) {</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;370</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                        <span class="comment">// skip this one</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;371</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                        <span class="keyword">continue</span>;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;372</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                    }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;373</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                } <span class="keyword">catch</span> (FieldnameNotFoundException e) {</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;374</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                    <span class="comment">// nothing to do</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;375</td>
  <td class="nbHitsCovered">&nbsp;45</td>
  <td class="src"><pre class="src">&nbsp;                }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;376</td>
  <td class="nbHitsCovered">&nbsp;45</td>
  <td class="src"><pre class="src">&nbsp;                <span class="keyword">if</span> (! usePropertyNamesForColumns) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;377</td>
  <td class="nbHitsCovered">&nbsp;30</td>
  <td class="src"><pre class="src">&nbsp;                    column = BasicTranslator.makeDBNameFromCamelCase(property);</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;378</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;379</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                <span class="comment">// check for annotation override to column name</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;380</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                <span class="keyword">try</span> {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;381</td>
  <td class="nbHitsCovered">&nbsp;45</td>
  <td class="src"><pre class="src">&nbsp;                    PersistentColumnName annotation = (PersistentColumnName) classFields.getFieldAnnotation(PersistentColumnName.<span class="keyword">class</span>, property);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;382</td>
  <td class="nbHitsCovered">&nbsp;45</td>
  <td class="src"><pre class="src">&nbsp;                    <span class="keyword">if</span> (annotation != <span class="keyword">null</span>) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;383</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                        column = annotation.value();</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;384</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                    }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;385</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                } <span class="keyword">catch</span> (FieldnameNotFoundException e) {</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;386</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                    <span class="comment">// nothing to do</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;387</td>
  <td class="nbHitsCovered">&nbsp;45</td>
  <td class="src"><pre class="src">&nbsp;                }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;388</td>
  <td class="nbHitsCovered">&nbsp;45</td>
  <td class="src"><pre class="src">&nbsp;                nr.setNameMapping(property, column);</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;389</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                <span class="comment">// special handling for foreign keys identified by persistent types inside this object</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;390</td>
  <td class="nbHitsCovered">&nbsp;45</td>
  <td class="src"><pre class="src">&nbsp;                Class&lt;?&gt; pType = types.get(property);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;391</td>
  <td class="nbHitsCovered">&nbsp;45</td>
  <td class="src"><pre class="src">&nbsp;                <span class="keyword">if</span> (getPersistentClasses().contains(pType)) {</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;392</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                    <span class="comment">// this is another persistent object so this must be a foreign key</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;393</td>
  <td class="nbHitsCovered">&nbsp;10</td>
  <td class="src"><pre class="src">&nbsp;                    String pId = findIdProperty(pType);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;394</td>
  <td class="nbHitsCovered">&nbsp;10</td>
  <td class="src"><pre class="src">&nbsp;                    String fkProp = property + <span class="string">"."</span> + pId;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;395</td>
  <td class="nbHitsCovered">&nbsp;10</td>
  <td class="src"><pre class="src">&nbsp;                    nr.setForeignKeyMapping(fkProp, column);</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;396</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;397</td>
  <td class="nbHitsCovered">&nbsp;45</td>
  <td class="src"><pre class="src">&nbsp;            }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;398</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            <span class="comment">// add in the special id marker and make sure the id is set right</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;399</td>
  <td class="nbHitsCovered">&nbsp;15</td>
  <td class="src"><pre class="src">&nbsp;            nr.setIdentifierProperty( findIdProperty(type) );</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;400</td>
  <td class="nbHitsCovered">&nbsp;15</td>
  <td class="src"><pre class="src">&nbsp;            namesRecordsCache.put(type, nr);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;401</td>
  <td class="nbHitsCovered">&nbsp;15</td>
  <td class="src"><pre class="src">&nbsp;            <span class="keyword">if</span> (dm <span class="keyword">instanceof</span> SimpleDataMapper) {</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;402</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                <span class="comment">// put this NamesRecord back into the DataMapper</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;403</td>
  <td class="nbHitsCovered">&nbsp;15</td>
  <td class="src"><pre class="src">&nbsp;                ((SimpleDataMapper)dm).setNamesRecord(nr);</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;404</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;405</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;406</td>
  <td class="nbHitsCovered">&nbsp;8169</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> nr;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;407</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;408</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;409</td>
  <td class="nbHitsCovered">&nbsp;18</td>
  <td class="src"><pre class="src">&nbsp;    <span class="keyword">private</span> DatabaseTranslator databaseTranslator = <span class="keyword">null</span>;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;410</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;411</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * Force the current database translator to be this one</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;412</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;413</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    <span class="keyword">public</span> <span class="keyword">void</span> setDatabaseTranslator(DatabaseTranslator databaseTranslator) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;414</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;        <span class="keyword">if</span> (databaseTranslator != <span class="keyword">null</span>) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;415</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            <span class="keyword">this</span>.databaseTranslator = databaseTranslator;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;416</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;417</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    }</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;418</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    <span class="keyword">protected</span> DatabaseTranslator getDatabaseTranslator() {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;419</td>
  <td class="nbHitsCovered">&nbsp;1005</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (<span class="keyword">this</span>.databaseTranslator == <span class="keyword">null</span>) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;420</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            databaseTranslator = <span class="keyword">new</span> HSQLDBTranslator();</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;421</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;422</td>
  <td class="nbHitsCovered">&nbsp;1005</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> <span class="keyword">this</span>.databaseTranslator;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;423</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;424</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;425</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;426</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * Initialize the database translator</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;427</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;428</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    <span class="keyword">protected</span> <span class="keyword">void</span> initDatabaseTranslator() {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;429</td>
  <td class="nbHitsCovered">&nbsp;11</td>
  <td class="src"><pre class="src">&nbsp;        String type = getDatabaseType();</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;430</td>
  <td class="nbHitsCovered">&nbsp;11</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (<span class="keyword">this</span>.databaseTranslator == <span class="keyword">null</span>) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;431</td>
  <td class="nbHitsCovered">&nbsp;11</td>
  <td class="src"><pre class="src">&nbsp;            <span class="keyword">if</span> (DatabaseTranslator.DBTYPE_DB2.equalsIgnoreCase(type)) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;432</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                <span class="keyword">this</span>.databaseTranslator = <span class="keyword">new</span> DB2Translator();</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;433</td>
  <td class="nbHitsCovered">&nbsp;11</td>
  <td class="src"><pre class="src">&nbsp;            } <span class="keyword">else</span> <span class="keyword">if</span> (DatabaseTranslator.DBTYPE_DERBY.equalsIgnoreCase(type)) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;434</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                <span class="keyword">this</span>.databaseTranslator = <span class="keyword">new</span> DerbyTranslator();</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;435</td>
  <td class="nbHitsCovered">&nbsp;11</td>
  <td class="src"><pre class="src">&nbsp;            } <span class="keyword">else</span> <span class="keyword">if</span> (DatabaseTranslator.DBTYPE_HSQLDB.equalsIgnoreCase(type)) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;436</td>
  <td class="nbHitsCovered">&nbsp;11</td>
  <td class="src"><pre class="src">&nbsp;                <span class="keyword">this</span>.databaseTranslator = <span class="keyword">new</span> HSQLDBTranslator();</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;437</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            } <span class="keyword">else</span> <span class="keyword">if</span> (DatabaseTranslator.DBTYPE_MSSQL.equalsIgnoreCase(type)) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;438</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                <span class="keyword">this</span>.databaseTranslator = <span class="keyword">new</span> MSSQLTranslator();</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;439</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            } <span class="keyword">else</span> <span class="keyword">if</span> (DatabaseTranslator.DBTYPE_MYSQL.equalsIgnoreCase(type)) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;440</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                <span class="keyword">this</span>.databaseTranslator = <span class="keyword">new</span> MySQLTranslator();</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;441</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            } <span class="keyword">else</span> <span class="keyword">if</span> (DatabaseTranslator.DBTYPE_ORACLE.equalsIgnoreCase(type)) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;442</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                <span class="keyword">this</span>.databaseTranslator = <span class="keyword">new</span> OracleTranslator();</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;443</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            } <span class="keyword">else</span> <span class="keyword">if</span> (DatabaseTranslator.DBTYPE_POSTGRES.equalsIgnoreCase(type)) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;444</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                <span class="keyword">this</span>.databaseTranslator = <span class="keyword">new</span> PostgresTranslator();</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;445</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            } <span class="keyword">else</span> {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;446</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                <span class="keyword">throw</span> <span class="keyword">new</span> UnsupportedOperationException(<span class="string">"No translator for this database type: "</span> + type);</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;447</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;448</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;449</td>
  <td class="nbHitsCovered">&nbsp;11</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;450</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;451</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;452</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * Initialize the persistent classes</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;453</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;454</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    <span class="keyword">protected</span> <span class="keyword">void</span> initPersistentClasses() {</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;455</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        <span class="comment">// init the list of classes and mappers related to them and execute DDL if needed</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;456</td>
  <td class="nbHitsCovered">&nbsp;11</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">for</span> (Class&lt;?&gt; type : getPersistentClasses()) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;457</td>
  <td class="nbHitsCovered">&nbsp;20</td>
  <td class="src"><pre class="src">&nbsp;            DataMapper dm = getDataMapper(type);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;458</td>
  <td class="nbHitsCovered">&nbsp;20</td>
  <td class="src"><pre class="src">&nbsp;            <span class="keyword">if</span> (autoDDL) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;459</td>
  <td class="nbHitsCovered">&nbsp;20</td>
  <td class="src"><pre class="src">&nbsp;                InputStream ddlIS = <span class="keyword">null</span>;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;460</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                <span class="comment">// try to get DDL from the mapper first</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;461</td>
  <td class="nbHitsCovered">&nbsp;20</td>
  <td class="src"><pre class="src">&nbsp;                String ddl = dm.generateDDL(getDatabaseType());</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;462</td>
  <td class="nbHitsCovered">&nbsp;20</td>
  <td class="src"><pre class="src">&nbsp;                <span class="keyword">if</span> ( ddl == <span class="keyword">null</span> || <span class="string">""</span>.equals(ddl) ) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;463</td>
  <td class="nbHitsCovered">&nbsp;3</td>
  <td class="src"><pre class="src">&nbsp;                    <span class="keyword">if</span> (dm <span class="keyword">instanceof</span> SimpleDataMapper) {</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;464</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                        <span class="comment">// try loading from a file if set</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;465</td>
  <td class="nbHitsCovered">&nbsp;3</td>
  <td class="src"><pre class="src">&nbsp;                        SimpleDataMapper sdm = (SimpleDataMapper) dm;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;466</td>
  <td class="nbHitsCovered">&nbsp;3</td>
  <td class="src"><pre class="src">&nbsp;                        String filepath = sdm.getDbTypeToFilename().get(getDatabaseType());</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;467</td>
  <td class="nbHitsCovered">&nbsp;3</td>
  <td class="src"><pre class="src">&nbsp;                        <span class="keyword">if</span> (filepath != <span class="keyword">null</span>) {</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;468</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                            <span class="comment">// cleanup filename</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;469</td>
  <td class="nbHitsCovered">&nbsp;3</td>
  <td class="src"><pre class="src">&nbsp;                            <span class="keyword">if</span> (filepath.startsWith(<span class="string">"/"</span>)) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;470</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                                filepath = filepath.substring(1);</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;471</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                            }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;472</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                            <span class="comment">// try looking in the classloader of the thread first</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;473</td>
  <td class="nbHitsCovered">&nbsp;3</td>
  <td class="src"><pre class="src">&nbsp;                            ddlIS = getInputStreamFromClassloader(Thread.currentThread().getContextClassLoader(), filepath);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;474</td>
  <td class="nbHitsCovered">&nbsp;3</td>
  <td class="src"><pre class="src">&nbsp;                            <span class="keyword">if</span> (ddlIS == <span class="keyword">null</span>) {</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;475</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                                <span class="comment">// next try the classloader for this DAO</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;476</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                                ddlIS = getInputStreamFromClassloader(<span class="keyword">this</span>.getClass().getClassLoader(), filepath);</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;477</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                            }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;478</td>
  <td class="nbHitsCovered">&nbsp;3</td>
  <td class="src"><pre class="src">&nbsp;                            <span class="keyword">if</span> (ddlIS == <span class="keyword">null</span>) {</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;479</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                                <span class="comment">// next try the classloader for persistent type</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;480</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                                ddlIS = getInputStreamFromClassloader(type.getClassLoader(), filepath);</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;481</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                            }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;482</td>
  <td class="nbHitsCovered">&nbsp;3</td>
  <td class="src"><pre class="src">&nbsp;                            <span class="keyword">if</span> (ddlIS == <span class="keyword">null</span>) {</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;483</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                                <span class="comment">// we got a filename but did not find the file contents, we need to die</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;484</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                                <span class="keyword">throw</span> <span class="keyword">new</span> IllegalArgumentException(<span class="string">"Could not find find DDL file resource ("</span>+filepath+<span class="string">") for DB ("</span>+getDatabaseType()+<span class="string">") in any searched classloader, cannot execute DDL"</span>);</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;485</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                            }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;486</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;487</td>
  <td class="nbHitsCovered">&nbsp;3</td>
  <td class="src"><pre class="src">&nbsp;                    } <span class="keyword">else</span> {</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;488</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                        <span class="comment">// nothing to do here: we have a blank ddl and this is not a simple mapper so just continue on -AZ</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;489</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;490</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                } <span class="keyword">else</span> {</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;491</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                    <span class="comment">// turn DDL into an IS</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;492</td>
  <td class="nbHitsCovered">&nbsp;17</td>
  <td class="src"><pre class="src">&nbsp;                    ddlIS = <span class="keyword">new</span> ByteArrayInputStream(ddl.getBytes());</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;493</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;494</td>
  <td class="nbHitsCovered">&nbsp;20</td>
  <td class="src"><pre class="src">&nbsp;                <span class="keyword">if</span> (ddlIS != <span class="keyword">null</span>) {</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;495</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                    <span class="comment">// execute the ddl</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;496</td>
  <td class="nbHitsCovered">&nbsp;20</td>
  <td class="src"><pre class="src">&nbsp;                    executeDDLforType(ddlIS, type);</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;497</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;498</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;499</td>
  <td class="nbHitsCovered">&nbsp;20</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;500</td>
  <td class="nbHitsCovered">&nbsp;11</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;501</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;502</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;503</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * Get the input stream from this classloader</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;504</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;505</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    <span class="keyword">private</span> InputStream getInputStreamFromClassloader(ClassLoader cl, String filename) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;506</td>
  <td class="nbHitsCovered">&nbsp;3</td>
  <td class="src"><pre class="src">&nbsp;        InputStream ddlIS = <span class="keyword">null</span>;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;507</td>
  <td class="nbHitsCovered">&nbsp;3</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (cl != <span class="keyword">null</span>) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;508</td>
  <td class="nbHitsCovered">&nbsp;3</td>
  <td class="src"><pre class="src">&nbsp;            ddlIS = cl.getResourceAsStream(filename);</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;509</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;510</td>
  <td class="nbHitsCovered">&nbsp;3</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> ddlIS;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;511</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;512</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;513</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;514</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * Starts the DAO using the settings that have been pushed into it so far &lt;br/&gt;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;515</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * There is no need to trigger this if it is being controlled by spring as spring</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;516</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * will call {@link #initDao()} automatically which calls this method</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;517</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @throws RuntimeException if the dao fails to start</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;518</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;519</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    <span class="keyword">public</span> <span class="keyword">void</span> startup() {</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;520</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">try</span> {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;521</td>
  <td class="nbHitsCovered">&nbsp;1</td>
  <td class="src"><pre class="src">&nbsp;            initDao();</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;522</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;        } <span class="keyword">catch</span> (Exception e) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;523</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            <span class="keyword">throw</span> <span class="keyword">new</span> RuntimeException(<span class="string">"Failed to startup the dao: "</span> + e.getMessage(), e);</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;524</td>
  <td class="nbHitsCovered">&nbsp;1</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;525</td>
  <td class="nbHitsCovered">&nbsp;1</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;526</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;527</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;528</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * Default constructor - does nothing and leaves the object in an incomplete state,</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;529</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * you need to at least set the following:</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;530</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * {@link #setDataSource(DataSource)} &lt;br/&gt;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;531</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * {@link #setAutoDDL(boolean)} &lt;br/&gt;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;532</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * {@link #setAutoCommitDDL(boolean)} &lt;br/&gt;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;533</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * {@link #setDatabaseType(String)} &lt;br/&gt;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;534</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * {@link #setDataMappers(List)} &lt;br/&gt;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;535</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * &lt;br/&gt;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;536</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * This does not actually start the DAO, run {@link #startup()} to start it &lt;br/&gt;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;537</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * Note that this will be started automatically by Spring if this is created as a Spring bean,</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;538</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * no actions are necessary and setting an init method is not needed</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;539</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;540</td>
  <td class="nbHitsCovered">&nbsp;17</td>
  <td class="src"><pre class="src">&nbsp;    <span class="keyword">public</span> JdbcGenericDao() {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;541</td>
  <td class="nbHitsCovered">&nbsp;17</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;542</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;543</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;544</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * Complete constructor, sets all required values for running the DAO,</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;545</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * does not actually start the DAO, run {@link #startup()} to start it &lt;br/&gt;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;546</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * Note that this will be started automatically by Spring if this is created as a Spring bean,</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;547</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * no actions are necessary and setting an init method is not needed</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;548</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * </span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;549</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param dataSource the DataSource to use with this DAO</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;550</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param threadBoundDataSource if true then the DataSource will be bound to threads and </span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;551</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * only unbound and closed when {@link #closeConnection()} is called,</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;552</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * otherwise a new DataSource is obtained each time, </span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;553</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * this has no effect if the DataSource is a Spring DataSource</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;554</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param databaseType the databaseType that this DAO is connecting to (use constants in {@link DatabaseTranslator})</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;555</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param autoDDL if true then DDL is executed on DAO startup (can be run manually if desired)</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;556</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param autoCommitDDL if true then commit is executed after each DDL file is executed, if false then you need a TX manager to do this for you</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;557</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param dataMappers the data mappers which map this DAO to the tables</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;558</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;559</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="keyword">public</span> JdbcGenericDao(DataSource dataSource, <span class="keyword">boolean</span> threadBoundDataSource, </pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;560</td>
  <td class="nbHitsCovered">&nbsp;1</td>
  <td class="src"><pre class="src">&nbsp;            String databaseType, <span class="keyword">boolean</span> autoDDL, <span class="keyword">boolean</span> autoCommitDDL, DataMapper[] dataMappers) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;561</td>
  <td class="nbHitsCovered">&nbsp;1</td>
  <td class="src"><pre class="src">&nbsp;        setRequiredSettings(dataSource, threadBoundDataSource, databaseType, autoDDL, autoCommitDDL, dataMappers);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;562</td>
  <td class="nbHitsCovered">&nbsp;1</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;563</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;564</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;565</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * Set all required settings for running the DAO,</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;566</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * can be used in the cases where using the complete constructor is inconvenient &lt;br/&gt;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;567</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * This does not actually start the DAO, run {@link #startup()} to start it &lt;br/&gt;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;568</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * Note that this will be started automatically by Spring if this is created as a Spring bean,</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;569</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * no actions are necessary and setting an init method is not needed</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;570</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * </span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;571</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param dataSource the DataSource to use with this DAO</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;572</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param threadBoundDataSource if true then the DataSource will be bound to threads and </span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;573</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * only unbound and closed when {@link #closeConnection()} is called,</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;574</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * otherwise a new DataSource is obtained each time, </span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;575</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * this has no effect if the DataSource is a Spring DataSource</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;576</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param databaseType the databaseType that this DAO is connecting to (use constants in {@link DatabaseTranslator})</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;577</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param autoDDL if true then DDL is executed on DAO startup (can be run manually if desired)</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;578</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param autoCommitDDL if true then commit is executed after each DDL file is executed, if false then you need a TX manager to do this for you</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;579</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param dataMappers the data mappers which map this DAO to the tables</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;580</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;581</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    <span class="keyword">public</span> <span class="keyword">void</span> setRequiredSettings(DataSource dataSource, <span class="keyword">boolean</span> threadBoundDataSource, </span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;582</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            String databaseType, <span class="keyword">boolean</span> autoDDL, <span class="keyword">boolean</span> autoCommitDDL, DataMapper[] dataMappers) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;583</td>
  <td class="nbHitsCovered">&nbsp;1</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (dataSource != <span class="keyword">null</span>) {</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;584</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            <span class="comment">// correctly sets the datasource if non-spring or spring</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;585</td>
  <td class="nbHitsCovered">&nbsp;1</td>
  <td class="src"><pre class="src">&nbsp;            setNonSpringDataSource(dataSource, threadBoundDataSource);</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;586</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;587</td>
  <td class="nbHitsCovered">&nbsp;1</td>
  <td class="src"><pre class="src">&nbsp;        setDatabaseType(databaseType);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;588</td>
  <td class="nbHitsCovered">&nbsp;1</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (dataMappers == <span class="keyword">null</span> || dataMappers.length == 0) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;589</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            <span class="keyword">throw</span> <span class="keyword">new</span> IllegalArgumentException(<span class="string">"DataMappers must be set and must be greater than one"</span>);</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;590</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;591</td>
  <td class="nbHitsCovered">&nbsp;1</td>
  <td class="src"><pre class="src">&nbsp;        ArrayList&lt;DataMapper&gt; mappers = <span class="keyword">new</span> ArrayList&lt;DataMapper&gt;();</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;592</td>
  <td class="nbHitsCovered">&nbsp;2</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">for</span> (<span class="keyword">int</span> i = 0; i &lt; dataMappers.length; i++) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;593</td>
  <td class="nbHitsCovered">&nbsp;1</td>
  <td class="src"><pre class="src">&nbsp;            mappers.add(dataMappers[i]);</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;594</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;595</td>
  <td class="nbHitsCovered">&nbsp;1</td>
  <td class="src"><pre class="src">&nbsp;        setDataMappers(mappers);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;596</td>
  <td class="nbHitsCovered">&nbsp;1</td>
  <td class="src"><pre class="src">&nbsp;        setAutoDDL(autoDDL);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;597</td>
  <td class="nbHitsCovered">&nbsp;1</td>
  <td class="src"><pre class="src">&nbsp;        setAutoCommitDDL(autoCommitDDL);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;598</td>
  <td class="nbHitsCovered">&nbsp;1</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;599</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;600</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    @Override</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;601</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    <span class="keyword">protected</span> <span class="keyword">void</span> initDao() <span class="keyword">throws</span> Exception {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;602</td>
  <td class="nbHitsCovered">&nbsp;11</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">super</span>.initDao();</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;603</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        <span class="comment">// now we run our own inits</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;604</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        <span class="comment">// init the database translator based on the type</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;605</td>
  <td class="nbHitsCovered">&nbsp;11</td>
  <td class="src"><pre class="src">&nbsp;        initDatabaseTranslator();</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;606</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        <span class="comment">// init the list of classes and mappers related to them and execute DDL if needed</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;607</td>
  <td class="nbHitsCovered">&nbsp;11</td>
  <td class="src"><pre class="src">&nbsp;        initPersistentClasses();</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;608</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        <span class="comment">// init the caches</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;609</td>
  <td class="nbHitsCovered">&nbsp;11</td>
  <td class="src"><pre class="src">&nbsp;        initCaches();</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;610</td>
  <td class="nbHitsCovered">&nbsp;11</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;611</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;612</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;613</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * Find the tablename from the classname</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;614</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;615</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    <span class="keyword">protected</span> String getTableNameFromClass(Class&lt;?&gt; type) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;616</td>
  <td class="nbHitsCovered">&nbsp;1360</td>
  <td class="src"><pre class="src">&nbsp;        String tableName = getDataMapper(type).getTableName();</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;617</td>
  <td class="nbHitsCovered">&nbsp;1359</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (<span class="string">""</span>.equals(tableName) || tableName == <span class="keyword">null</span>) {</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;618</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            <span class="comment">// generate the table name based on defaults</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;619</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            tableName = BasicTranslator.makeTableNameFromClass(type);</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;620</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;621</td>
  <td class="nbHitsCovered">&nbsp;1359</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> tableName;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;622</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;623</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;624</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;625</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * Make an entity of type T from a map of DB data</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;626</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param &lt;T&gt;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;627</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param type a persistent entity type</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;628</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param data a map of column names to data values</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;629</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @return an entity of type T with the data from the map in the entity</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;630</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;631</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    @SuppressWarnings(<span class="string">"unchecked"</span>)</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;632</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    <span class="keyword">protected</span> &lt;T&gt; T makeEntityFromMap(Class&lt;T&gt; type, Map&lt;String, Object&gt; data) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;633</td>
  <td class="nbHitsCovered">&nbsp;545</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (type == <span class="keyword">null</span> || data == <span class="keyword">null</span>) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;634</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            <span class="keyword">throw</span> <span class="keyword">new</span> NullPointerException(<span class="string">"type and data cannot be null"</span>);</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;635</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;636</td>
  <td class="nbHitsCovered">&nbsp;545</td>
  <td class="src"><pre class="src">&nbsp;        T entity = <span class="keyword">null</span>;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;637</td>
  <td class="nbHitsCovered">&nbsp;545</td>
  <td class="src"><pre class="src">&nbsp;        DataMapper dm = getDataMapper(type);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;638</td>
  <td class="nbHitsCovered">&nbsp;545</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (dm != <span class="keyword">null</span> &amp;&amp; dm <span class="keyword">instanceof</span> EntityColumnMapper) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;639</td>
  <td class="nbHitsCovered">&nbsp;198</td>
  <td class="src"><pre class="src">&nbsp;            entity = (T) ((EntityColumnMapper)dm).mapColumnsToObject(data);</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;640</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;641</td>
  <td class="nbHitsCovered">&nbsp;545</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (entity == <span class="keyword">null</span>) {</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;642</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            <span class="comment">// use reflection to construct and push the values into the object</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;643</td>
  <td class="nbHitsCovered">&nbsp;362</td>
  <td class="src"><pre class="src">&nbsp;            Map&lt;String, Class&lt;?&gt;&gt; types = ReflectUtils.getInstance().getFieldTypes(type, FieldsFilter.WRITEABLE);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;644</td>
  <td class="nbHitsCovered">&nbsp;362</td>
  <td class="src"><pre class="src">&nbsp;            NamesRecord nr = getNamesRecord(type);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;645</td>
  <td class="nbHitsCovered">&nbsp;362</td>
  <td class="src"><pre class="src">&nbsp;            entity = ReflectUtils.getInstance().constructClass(type);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;646</td>
  <td class="nbHitsCovered">&nbsp;362</td>
  <td class="src"><pre class="src">&nbsp;            <span class="keyword">for</span> (Entry&lt;String, Object&gt; entry : data.entrySet()) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;647</td>
  <td class="nbHitsCovered">&nbsp;1086</td>
  <td class="src"><pre class="src">&nbsp;                String key = entry.getKey();</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;648</td>
  <td class="nbHitsCovered">&nbsp;1086</td>
  <td class="src"><pre class="src">&nbsp;                String property = nr.getPropertyForColumn(key);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;649</td>
  <td class="nbHitsCovered">&nbsp;1086</td>
  <td class="src"><pre class="src">&nbsp;                <span class="keyword">if</span> (property != <span class="keyword">null</span>) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;650</td>
  <td class="nbHitsCovered">&nbsp;1086</td>
  <td class="src"><pre class="src">&nbsp;                    Object value = entry.getValue();</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;651</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                    <span class="comment">// special handling for persistent types inside this type</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;652</td>
  <td class="nbHitsCovered">&nbsp;1086</td>
  <td class="src"><pre class="src">&nbsp;                    Class&lt;?&gt; pType = <span class="keyword">null</span>;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;653</td>
  <td class="nbHitsCovered">&nbsp;1086</td>
  <td class="src"><pre class="src">&nbsp;                    <span class="keyword">if</span> (types.containsKey(property)) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;654</td>
  <td class="nbHitsCovered">&nbsp;1086</td>
  <td class="src"><pre class="src">&nbsp;                        pType = types.get(property);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;655</td>
  <td class="nbHitsCovered">&nbsp;1086</td>
  <td class="src"><pre class="src">&nbsp;                        <span class="keyword">if</span> (! getPersistentClasses().contains(pType)) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;656</td>
  <td class="nbHitsCovered">&nbsp;1061</td>
  <td class="src"><pre class="src">&nbsp;                            pType = <span class="keyword">null</span>;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;657</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                        }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;658</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                    }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;659</td>
  <td class="nbHitsCovered">&nbsp;1086</td>
  <td class="src"><pre class="src">&nbsp;                    <span class="keyword">if</span> (pType != <span class="keyword">null</span>) {</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;660</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                        <span class="comment">// this is another persistent object so this must be a foreign key</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;661</td>
  <td class="nbHitsCovered">&nbsp;25</td>
  <td class="src"><pre class="src">&nbsp;                        String pId = getIdProperty(pType);</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;662</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                        <span class="comment">// TODO use the old way once reflect utils can build the path automatically</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;663</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                        <span class="comment">//                property = property + "." + pId;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;664</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                        <span class="comment">//                if (value != null </span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;665</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                        <span class="comment">//                &amp;&amp; value.getClass().isAssignableFrom(pType)) {</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;666</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                        <span class="comment">//                value = ReflectUtil.getInstance().getFieldValue(value, pId);</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;667</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                        <span class="comment">//                }</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;668</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                        <span class="comment">// this will create the object for us for now</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;669</td>
  <td class="nbHitsCovered">&nbsp;25</td>
  <td class="src"><pre class="src">&nbsp;                        Object pValue = value;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;670</td>
  <td class="nbHitsCovered">&nbsp;25</td>
  <td class="src"><pre class="src">&nbsp;                        <span class="keyword">if</span> (value != <span class="keyword">null</span> </pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;671</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                                &amp;&amp; value.getClass().isAssignableFrom(pType)) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;672</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                            pValue = ReflectUtils.getInstance().getFieldValue(value, pId);</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;673</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;674</td>
  <td class="nbHitsCovered">&nbsp;25</td>
  <td class="src"><pre class="src">&nbsp;                        value = ReflectUtils.getInstance().constructClass(pType);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;675</td>
  <td class="nbHitsCovered">&nbsp;25</td>
  <td class="src"><pre class="src">&nbsp;                        ReflectUtils.getInstance().setFieldValue(value, pId, pValue);</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;676</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                    }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;677</td>
  <td class="nbHitsCovered">&nbsp;1086</td>
  <td class="src"><pre class="src">&nbsp;                    ReflectUtils.getInstance().setFieldValue(entity, property, value);</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;678</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;679</td>
  <td class="nbHitsCovered">&nbsp;1086</td>
  <td class="src"><pre class="src">&nbsp;            }            </pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;680</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;681</td>
  <td class="nbHitsCovered">&nbsp;545</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> entity;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;682</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;683</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;684</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;685</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * Make a map of column names -&gt; column values from an entity</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;686</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param entity</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;687</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @return a map of the data in a persistent entity which has the column names as keys</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;688</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;689</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    <span class="keyword">protected</span> Map&lt;String, Object&gt; makeMapFromEntity(Object entity) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;690</td>
  <td class="nbHitsCovered">&nbsp;1021</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (entity == <span class="keyword">null</span>) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;691</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            <span class="keyword">throw</span> <span class="keyword">new</span> NullPointerException(<span class="string">"entity cannot be null"</span>);</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;692</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;693</td>
  <td class="nbHitsCovered">&nbsp;1021</td>
  <td class="src"><pre class="src">&nbsp;        Class&lt;?&gt; type = entity.getClass();</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;694</td>
  <td class="nbHitsCovered">&nbsp;1021</td>
  <td class="src"><pre class="src">&nbsp;        Map&lt;String, Object&gt; data = <span class="keyword">null</span>;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;695</td>
  <td class="nbHitsCovered">&nbsp;1021</td>
  <td class="src"><pre class="src">&nbsp;        DataMapper dm = getDataMapper(type);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;696</td>
  <td class="nbHitsCovered">&nbsp;1021</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (dm != <span class="keyword">null</span> &amp;&amp; dm <span class="keyword">instanceof</span> EntityColumnMapper) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;697</td>
  <td class="nbHitsCovered">&nbsp;392</td>
  <td class="src"><pre class="src">&nbsp;            data = ((EntityColumnMapper)dm).mapObjectToColumns(entity);</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;698</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;699</td>
  <td class="nbHitsCovered">&nbsp;1021</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (data == <span class="keyword">null</span> || data.isEmpty()) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;700</td>
  <td class="nbHitsCovered">&nbsp;629</td>
  <td class="src"><pre class="src">&nbsp;            <span class="keyword">if</span> (data == <span class="keyword">null</span>) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;701</td>
  <td class="nbHitsCovered">&nbsp;629</td>
  <td class="src"><pre class="src">&nbsp;                data = <span class="keyword">new</span> HashMap&lt;String, Object&gt;();</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;702</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;703</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            <span class="comment">// get data from object using reflection</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;704</td>
  <td class="nbHitsCovered">&nbsp;629</td>
  <td class="src"><pre class="src">&nbsp;            Map&lt;String, Class&lt;?&gt;&gt; types = ReflectUtils.getInstance().getFieldTypes(type, FieldsFilter.ALL); <span class="comment">// faster</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;705</td>
  <td class="nbHitsCovered">&nbsp;629</td>
  <td class="src"><pre class="src">&nbsp;            Map&lt;String, Object&gt; objectValues = ReflectUtils.getInstance().getObjectValues(entity, FieldsFilter.READABLE, <span class="keyword">false</span>);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;706</td>
  <td class="nbHitsCovered">&nbsp;629</td>
  <td class="src"><pre class="src">&nbsp;            NamesRecord nr = getNamesRecord(type);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;707</td>
  <td class="nbHitsCovered">&nbsp;629</td>
  <td class="src"><pre class="src">&nbsp;            <span class="keyword">for</span> (Entry&lt;String, Object&gt; entry : objectValues.entrySet()) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;708</td>
  <td class="nbHitsCovered">&nbsp;1887</td>
  <td class="src"><pre class="src">&nbsp;                String property = entry.getKey();</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;709</td>
  <td class="nbHitsCovered">&nbsp;1887</td>
  <td class="src"><pre class="src">&nbsp;                String dbName = nr.getColumnForProperty(property);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;710</td>
  <td class="nbHitsCovered">&nbsp;1887</td>
  <td class="src"><pre class="src">&nbsp;                <span class="keyword">if</span> (dbName != <span class="keyword">null</span>) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;711</td>
  <td class="nbHitsCovered">&nbsp;1887</td>
  <td class="src"><pre class="src">&nbsp;                    Object value = entry.getValue();</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;712</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                    <span class="comment">// special handling for persistent types inside this type</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;713</td>
  <td class="nbHitsCovered">&nbsp;1887</td>
  <td class="src"><pre class="src">&nbsp;                    Class&lt;?&gt; pType = <span class="keyword">null</span>;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;714</td>
  <td class="nbHitsCovered">&nbsp;1887</td>
  <td class="src"><pre class="src">&nbsp;                    <span class="keyword">if</span> (types.containsKey(property)) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;715</td>
  <td class="nbHitsCovered">&nbsp;1887</td>
  <td class="src"><pre class="src">&nbsp;                        pType = types.get(property);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;716</td>
  <td class="nbHitsCovered">&nbsp;1887</td>
  <td class="src"><pre class="src">&nbsp;                        <span class="keyword">if</span> (! getPersistentClasses().contains(pType)) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;717</td>
  <td class="nbHitsCovered">&nbsp;1798</td>
  <td class="src"><pre class="src">&nbsp;                            pType = <span class="keyword">null</span>;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;718</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                        }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;719</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                    }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;720</td>
  <td class="nbHitsCovered">&nbsp;1887</td>
  <td class="src"><pre class="src">&nbsp;                    <span class="keyword">if</span> (pType != <span class="keyword">null</span>) {</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;721</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                        <span class="comment">// this is another persistent object so this must be a foreign key</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;722</td>
  <td class="nbHitsCovered">&nbsp;89</td>
  <td class="src"><pre class="src">&nbsp;                        String pId = getIdProperty(pType);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;723</td>
  <td class="nbHitsCovered">&nbsp;89</td>
  <td class="src"><pre class="src">&nbsp;                        value = ReflectUtils.getInstance().getFieldValue(value, pId);</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;724</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                    }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;725</td>
  <td class="nbHitsCovered">&nbsp;1887</td>
  <td class="src"><pre class="src">&nbsp;                    data.put(dbName, value);</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;726</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;727</td>
  <td class="nbHitsCovered">&nbsp;1887</td>
  <td class="src"><pre class="src">&nbsp;            }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;728</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;729</td>
  <td class="nbHitsCovered">&nbsp;1021</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> data;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;730</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;731</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;732</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">// *********** Helper methods</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;733</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;734</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;735</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * Logs a message to standard out, allows easy control over where logging is going later on</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;736</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * </span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;737</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param message the message to output</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;738</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;739</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    <span class="keyword">protected</span> <span class="keyword">void</span> logInfo(String message) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;740</td>
  <td class="nbHitsCovered">&nbsp;10</td>
  <td class="src"><pre class="src">&nbsp;        System.out.println(<span class="string">"INFO: [GenericDao] "</span> + message);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;741</td>
  <td class="nbHitsCovered">&nbsp;10</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;742</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;743</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;744</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * Logs a message to standard out, allows easy control over where logging is going later on</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;745</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * </span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;746</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param message the message to output</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;747</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;748</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    <span class="keyword">protected</span> <span class="keyword">void</span> logWarn(String message) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;749</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;        System.out.println(<span class="string">"WARN: [GenericDao] "</span> + message);</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;750</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    }</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;751</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;752</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;753</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * This will determine the id property correctly (but fairly inefficiently) so this should be cached,</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;754</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * use {@link #getIdProperty(Class)} to get the id property for a class</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;755</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param type a persistent type</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;756</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @return</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;757</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;758</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    <span class="keyword">protected</span> String findIdProperty(Class&lt;?&gt; type) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;759</td>
  <td class="nbHitsCovered">&nbsp;49</td>
  <td class="src"><pre class="src">&nbsp;        String idProp = <span class="keyword">null</span>;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;760</td>
  <td class="nbHitsCovered">&nbsp;49</td>
  <td class="src"><pre class="src">&nbsp;        DataMapper dm = getDataMapper(type);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;761</td>
  <td class="nbHitsCovered">&nbsp;49</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (dm != <span class="keyword">null</span>) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;762</td>
  <td class="nbHitsCovered">&nbsp;49</td>
  <td class="src"><pre class="src">&nbsp;            idProp = dm.getIdPropertyName();</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;763</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;764</td>
  <td class="nbHitsCovered">&nbsp;49</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (classes.contains(type)) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;765</td>
  <td class="nbHitsCovered">&nbsp;49</td>
  <td class="src"><pre class="src">&nbsp;            <span class="keyword">if</span> (idProp == <span class="keyword">null</span>) {</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;766</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                <span class="comment">// look for the annotation</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;767</td>
  <td class="nbHitsCovered">&nbsp;19</td>
  <td class="src"><pre class="src">&nbsp;                idProp = ReflectUtils.getInstance().getFieldNameWithAnnotation(type, PersistentId.<span class="keyword">class</span>);</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;768</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;769</td>
  <td class="nbHitsCovered">&nbsp;49</td>
  <td class="src"><pre class="src">&nbsp;            <span class="keyword">if</span> (idProp == <span class="keyword">null</span>) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;770</td>
  <td class="nbHitsCovered">&nbsp;8</td>
  <td class="src"><pre class="src">&nbsp;                idProp = <span class="string">"id"</span>;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;771</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;772</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;773</td>
  <td class="nbHitsCovered">&nbsp;49</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> idProp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;774</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;775</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;776</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;777</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param type a persistent type</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;778</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @return the id column name</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;779</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;780</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    <span class="keyword">public</span> String getIdColumn(Class&lt;?&gt; type) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;781</td>
  <td class="nbHitsCovered">&nbsp;1247</td>
  <td class="src"><pre class="src">&nbsp;        String idProp = getIdProperty(type);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;782</td>
  <td class="nbHitsCovered">&nbsp;1247</td>
  <td class="src"><pre class="src">&nbsp;        String idColumn = getNamesRecord(type).getColumnForProperty(idProp);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;783</td>
  <td class="nbHitsCovered">&nbsp;1247</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (idColumn == <span class="keyword">null</span> &amp;&amp; classes.contains(type)) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;784</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            idColumn = <span class="string">"ID"</span>;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;785</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;786</td>
  <td class="nbHitsCovered">&nbsp;1247</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> idColumn;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;787</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;788</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;789</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;790</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param object a persistent object</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;791</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @return the value in the id property for the supplied object</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;792</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;793</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    <span class="keyword">protected</span> Object getIdValue(Object object) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;794</td>
  <td class="nbHitsCovered">&nbsp;2</td>
  <td class="src"><pre class="src">&nbsp;        Class&lt;?&gt; entityClass = object.getClass();</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;795</td>
  <td class="nbHitsCovered">&nbsp;2</td>
  <td class="src"><pre class="src">&nbsp;        Object id = <span class="keyword">null</span>;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;796</td>
  <td class="nbHitsCovered">&nbsp;2</td>
  <td class="src"><pre class="src">&nbsp;        String idProp = getIdProperty(entityClass);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;797</td>
  <td class="nbHitsCovered">&nbsp;2</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (idProp != <span class="keyword">null</span>) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;798</td>
  <td class="nbHitsCovered">&nbsp;2</td>
  <td class="src"><pre class="src">&nbsp;            id = ReflectUtils.getInstance().getFieldValue(object, idProp);</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;799</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;800</td>
  <td class="nbHitsCovered">&nbsp;2</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> id;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;801</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;802</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;803</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;804</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * This helper method will convert the incoming data if it needs to be</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;805</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * converted for the given column, otherwise it will do nothing to the value</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;806</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param type the persistent class type</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;807</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param column the name of the column this value is associated with</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;808</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param value the value to convert</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;809</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @return the converted value or the original value if no conversion needed</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;810</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;811</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    <span class="keyword">protected</span> Object convertColumn(Class&lt;?&gt; type, String column, Object value) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;812</td>
  <td class="nbHitsCovered">&nbsp;3073</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (type != <span class="keyword">null</span> &amp;&amp; column != <span class="keyword">null</span>) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;813</td>
  <td class="nbHitsCovered">&nbsp;3073</td>
  <td class="src"><pre class="src">&nbsp;            NamesRecord namesRecord = getNamesRecord(type);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;814</td>
  <td class="nbHitsCovered">&nbsp;3073</td>
  <td class="src"><pre class="src">&nbsp;            value = JDBCUtils.convertColumn(namesRecord, column, value);</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;815</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;816</td>
  <td class="nbHitsCovered">&nbsp;3073</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> value;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;817</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;818</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;819</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;820</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @return the template to use when generating insert statements,</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;821</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * uses the {@link StatementMapper#TABLE_NAME}, {@link StatementMapper#COLUMNS} and {@link StatementMapper#VALUES} constants to indicate replacements</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;822</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;823</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    <span class="keyword">public</span> String getInsertTemplate(Class&lt;?&gt; type) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;824</td>
  <td class="nbHitsCovered">&nbsp;983</td>
  <td class="src"><pre class="src">&nbsp;        DataMapper dm = getDataMapper(type);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;825</td>
  <td class="nbHitsCovered">&nbsp;983</td>
  <td class="src"><pre class="src">&nbsp;        String template = <span class="keyword">null</span>;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;826</td>
  <td class="nbHitsCovered">&nbsp;983</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (dm <span class="keyword">instanceof</span> StatementMapper) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;827</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            template = ((StatementMapper)dm).getInsertTemplate();</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;828</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;829</td>
  <td class="nbHitsCovered">&nbsp;983</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (template == <span class="keyword">null</span> || <span class="string">""</span>.equals(template)) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;830</td>
  <td class="nbHitsCovered">&nbsp;983</td>
  <td class="src"><pre class="src">&nbsp;            template = StatementMapper.BASIC_INSERT;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;831</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;832</td>
  <td class="nbHitsCovered">&nbsp;983</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> template;      </pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;833</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;834</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;835</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;836</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @return the template to use when generating selects,</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;837</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * uses the {@link StatementMapper#SELECT}, {@link StatementMapper#TABLE_NAME}, and {@link StatementMapper#WHERE} constants to indicate replacements</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;838</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;839</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    <span class="keyword">public</span> String getSelectTemplate(Class&lt;?&gt; type) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;840</td>
  <td class="nbHitsCovered">&nbsp;264</td>
  <td class="src"><pre class="src">&nbsp;        DataMapper dm = getDataMapper(type);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;841</td>
  <td class="nbHitsCovered">&nbsp;264</td>
  <td class="src"><pre class="src">&nbsp;        String template = <span class="keyword">null</span>;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;842</td>
  <td class="nbHitsCovered">&nbsp;264</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (dm <span class="keyword">instanceof</span> StatementMapper) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;843</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            template = ((StatementMapper)dm).getSelectTemplate();</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;844</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;845</td>
  <td class="nbHitsCovered">&nbsp;264</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (template == <span class="keyword">null</span> || <span class="string">""</span>.equals(template)) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;846</td>
  <td class="nbHitsCovered">&nbsp;264</td>
  <td class="src"><pre class="src">&nbsp;            template = StatementMapper.BASIC_SELECT;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;847</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;848</td>
  <td class="nbHitsCovered">&nbsp;264</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> template;      </pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;849</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;850</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;851</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;852</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @return the template to use when generating updates,</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;853</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * uses the {@link StatementMapper#TABLE_NAME}, {@link StatementMapper#UPDATE} and {@link StatementMapper#WHERE} constants to indicate replacements</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;854</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;855</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    <span class="keyword">public</span> String getUpdateTemplate(Class&lt;?&gt; type) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;856</td>
  <td class="nbHitsCovered">&nbsp;25</td>
  <td class="src"><pre class="src">&nbsp;        DataMapper dm = getDataMapper(type);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;857</td>
  <td class="nbHitsCovered">&nbsp;25</td>
  <td class="src"><pre class="src">&nbsp;        String template = <span class="keyword">null</span>;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;858</td>
  <td class="nbHitsCovered">&nbsp;25</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (dm <span class="keyword">instanceof</span> StatementMapper) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;859</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            template = ((StatementMapper)dm).getUpdateTemplate();</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;860</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;861</td>
  <td class="nbHitsCovered">&nbsp;25</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (template == <span class="keyword">null</span> || <span class="string">""</span>.equals(template)) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;862</td>
  <td class="nbHitsCovered">&nbsp;25</td>
  <td class="src"><pre class="src">&nbsp;            template = StatementMapper.BASIC_UPDATE;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;863</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;864</td>
  <td class="nbHitsCovered">&nbsp;25</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> template;      </pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;865</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;866</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;867</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;868</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @return the template to use when generating deletes,</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;869</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * uses the {@link StatementMapper#TABLE_NAME} and {@link StatementMapper#WHERE} constants to indicate replacements</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;870</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;871</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    <span class="keyword">public</span> String getDeleteTemplate(Class&lt;?&gt; type) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;872</td>
  <td class="nbHitsCovered">&nbsp;38</td>
  <td class="src"><pre class="src">&nbsp;        DataMapper dm = getDataMapper(type);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;873</td>
  <td class="nbHitsCovered">&nbsp;38</td>
  <td class="src"><pre class="src">&nbsp;        String template = <span class="keyword">null</span>;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;874</td>
  <td class="nbHitsCovered">&nbsp;38</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (dm <span class="keyword">instanceof</span> StatementMapper) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;875</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            template = ((StatementMapper)dm).getDeleteTemplate();</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;876</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;877</td>
  <td class="nbHitsCovered">&nbsp;38</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (template == <span class="keyword">null</span> || <span class="string">""</span>.equals(template)) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;878</td>
  <td class="nbHitsCovered">&nbsp;38</td>
  <td class="src"><pre class="src">&nbsp;            template = StatementMapper.BASIC_DELETE;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;879</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;880</td>
  <td class="nbHitsCovered">&nbsp;38</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> template;      </pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;881</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;882</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;883</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;884</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">// ********* DDL methods</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;885</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;886</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;887</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * Clear the table associated with this DAO persistent class</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;888</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param type any persistent type</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;889</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;890</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    <span class="keyword">public</span> <span class="keyword">void</span> clearDataForType(Class&lt;?&gt; type) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;891</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;        String sql = <span class="string">"TRUNCATE TABLE "</span> + getTableNameFromClass(type);</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;892</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">try</span> {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;893</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            getSpringJdbcTemplate().execute(sql);</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;894</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            <span class="keyword">if</span> (showSQL) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;895</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                logInfo(<span class="string">"SQL="</span>+sql);</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;896</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;897</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;        } <span class="keyword">catch</span> (DataAccessException e) {</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;898</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            <span class="comment">// ok, try doing the clear using a delete from which is much slower</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;899</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            sql = <span class="string">"DELETE FROM "</span> + getTableNameFromClass(type);</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;900</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            <span class="keyword">if</span> (showSQL) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;901</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                logInfo(<span class="string">"SQL="</span>+sql);</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;902</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;903</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            getSpringJdbcTemplate().execute(sql);</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;904</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        } <span class="keyword">finally</span> {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;905</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            commitTransaction();</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;906</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;        }</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;907</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    }</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;908</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;909</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;910</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * Drop the table associated with this persistent type</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;911</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param type any persistent type</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;912</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;913</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    <span class="keyword">public</span> <span class="keyword">void</span> dropTableForType(Class&lt;?&gt; type) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;914</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;        String sql = <span class="string">"DROP TABLE "</span> + getTableNameFromClass(type);</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;915</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">try</span> {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;916</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            <span class="keyword">if</span> (showSQL) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;917</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                logInfo(<span class="string">"SQL="</span>+sql);</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;918</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;919</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            getSpringJdbcTemplate().execute(<span class="string">"DROP TABLE "</span> + getTableNameFromClass(type));</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;920</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            commitTransaction();</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;921</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;        } <span class="keyword">catch</span> (DataAccessException e) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;922</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            rollbackTransaction();</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;923</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            <span class="keyword">throw</span> e;</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;924</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;        }</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;925</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    }</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;926</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;927</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;928</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * Execute a DDL (database definition language) script, this will execute</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;929</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * a set of DDL commands which are fed in via an InputStream&lt;br/&gt;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;930</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * The first non-comment ('--') line will be run, and if successful, </span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;931</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * all other non-comment lines will be run. SQL statements may be on </span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;932</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * multiple lines but must have ';' terminators.&lt;br/&gt;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;933</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * &lt;br/&gt;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;934</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * &lt;b&gt;NOTE:&lt;/b&gt; The script should be located in the current ClassLoader,</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;935</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * in other words, it must be a visible resource that is packaged with</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;936</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * the code that is running this method&lt;br/&gt;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;937</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * Recommended (Example) usage:&lt;br/&gt;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;938</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * 1) Place the script into the src folder of your service impl project like so:</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;939</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * &lt;code&gt;impl/src/sql/oracle/myscript.sql&lt;/code&gt;&lt;br/&gt;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;940</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * 2) Load the sql files into the jar by setting up the maven pom like so:</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;941</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * &lt;xmp&gt;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;942</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">&lt;resources&gt;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;943</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">...</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;944</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">   &lt;resource&gt;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;945</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">      &lt;directory&gt;${basedir}/src/sql&lt;/directory&gt;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;946</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">      &lt;includes&gt;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;947</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">         &lt;include&gt;** /*.sql&lt;/include&gt;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;948</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">      &lt;/includes&gt;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;949</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">   &lt;/resource&gt;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;950</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">...</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;951</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">&lt;/resources&gt;&lt;/xmp&gt; </span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;952</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * &lt;b&gt;Note:&lt;/b&gt; remove the extra space between "**" and "/*.sql"&lt;br/&gt;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;953</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * 3) Execute the ddl script in the init method of your DAO (when it first starts up):</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;954</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * &lt;code&gt;ClassLoader loader = this.getClass().getClassLoader();&lt;/code&gt;&lt;br/&gt;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;955</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * &lt;code&gt;String ddlResource = getDatabaseType() + "/myscript.sql";&lt;/code&gt;&lt;br/&gt;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;956</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * &lt;code&gt;InputStream stream = loader.getResourceAsStream(ddlResource);&lt;/code&gt;&lt;br/&gt;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;957</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * &lt;code&gt;executeDDL(stream);&lt;/code&gt;&lt;br/&gt;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;958</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * </span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;959</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param sqlDDL the sql ddl commands to execute</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;960</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @throws IllegalArgumentException if ddl is invalid and cannot be executed</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;961</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;962</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    <span class="keyword">public</span> <span class="keyword">void</span> executeDDL(InputStream sqlDDL) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;963</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;        <span class="keyword">if</span> (sqlDDL == <span class="keyword">null</span>) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;964</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            <span class="keyword">throw</span> <span class="keyword">new</span> IllegalArgumentException(<span class="string">"sqlDDL cannot be null"</span>);</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;965</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;966</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;967</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;        executeDDLforType(sqlDDL, <span class="keyword">null</span>);</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;968</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    }</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;969</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;970</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    <span class="keyword">private</span> <span class="keyword">void</span> executeDDLforType(InputStream sqlDDL, Class&lt;?&gt; type) {</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;971</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        <span class="comment">// Now run the DDL commands if possible</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;972</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">try</span> {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;973</td>
  <td class="nbHitsCovered">&nbsp;20</td>
  <td class="src"><pre class="src">&nbsp;            <span class="keyword">if</span> (isAutoCommitDDL()) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;974</td>
  <td class="nbHitsCovered">&nbsp;4</td>
  <td class="src"><pre class="src">&nbsp;                commitTransaction(); <span class="comment">// start the transaction</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;975</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;976</td>
  <td class="nbHitsCovered">&nbsp;20</td>
  <td class="src"><pre class="src">&nbsp;            BufferedReader r = <span class="keyword">new</span> BufferedReader(<span class="keyword">new</span> InputStreamReader(sqlDDL));</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;977</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            <span class="keyword">try</span> {</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;978</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                <span class="comment">// read the first line, skipping any '--' comment lines</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;979</td>
  <td class="nbHitsCovered">&nbsp;20</td>
  <td class="src"><pre class="src">&nbsp;                <span class="keyword">boolean</span> firstLine = <span class="keyword">true</span>;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;980</td>
  <td class="nbHitsCovered">&nbsp;20</td>
  <td class="src"><pre class="src">&nbsp;                StringBuffer buf = <span class="keyword">new</span> StringBuffer();</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;981</td>
  <td class="nbHitsCovered">&nbsp;79</td>
  <td class="src"><pre class="src">&nbsp;                <span class="keyword">for</span> (String line = r.readLine(); line != <span class="keyword">null</span>; line = r.readLine()) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;982</td>
  <td class="nbHitsCovered">&nbsp;69</td>
  <td class="src"><pre class="src">&nbsp;                    line = line.trim();</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;983</td>
  <td class="nbHitsCovered">&nbsp;69</td>
  <td class="src"><pre class="src">&nbsp;                    <span class="keyword">if</span> (line.startsWith(<span class="string">"--"</span>)) <span class="keyword">continue</span>;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;984</td>
  <td class="nbHitsCovered">&nbsp;66</td>
  <td class="src"><pre class="src">&nbsp;                    <span class="keyword">if</span> (line.length() == 0) <span class="keyword">continue</span>;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;985</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;986</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                    <span class="comment">// add the line to the buffer</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;987</td>
  <td class="nbHitsCovered">&nbsp;54</td>
  <td class="src"><pre class="src">&nbsp;                    buf.append(<span class="string">' '</span>);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;988</td>
  <td class="nbHitsCovered">&nbsp;54</td>
  <td class="src"><pre class="src">&nbsp;                    buf.append(line);</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;989</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;990</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                    <span class="comment">// process if the line ends with a ';'</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;991</td>
  <td class="nbHitsCovered">&nbsp;54</td>
  <td class="src"><pre class="src">&nbsp;                    <span class="keyword">boolean</span> process = line.endsWith(<span class="string">";"</span>);</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;992</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;993</td>
  <td class="nbHitsCovered">&nbsp;54</td>
  <td class="src"><pre class="src">&nbsp;                    <span class="keyword">if</span> (!process) <span class="keyword">continue</span>;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;994</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;995</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                    <span class="comment">// remove trailing ';'</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;996</td>
  <td class="nbHitsCovered">&nbsp;20</td>
  <td class="src"><pre class="src">&nbsp;                    buf.setLength(buf.length() - 1);</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;997</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;998</td>
  <td class="nbHitsCovered">&nbsp;20</td>
  <td class="src"><pre class="src">&nbsp;                    String ddl = buf.toString().trim();</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;999</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                    <span class="comment">// FIXME do replacements even if we do not know the type</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1000</td>
  <td class="nbHitsCovered">&nbsp;20</td>
  <td class="src"><pre class="src">&nbsp;                    <span class="keyword">if</span> (type != <span class="keyword">null</span>) {</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1001</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                        <span class="comment">// handle ddl replacements</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1002</td>
  <td class="nbHitsCovered">&nbsp;20</td>
  <td class="src"><pre class="src">&nbsp;                        ddl = handleTypeReplacements(type, ddl);</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1003</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1004</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1005</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                    <span class="comment">// run the first line as the test - if it fails, we are done</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1006</td>
  <td class="nbHitsCovered">&nbsp;20</td>
  <td class="src"><pre class="src">&nbsp;                    <span class="keyword">if</span> (firstLine) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1007</td>
  <td class="nbHitsCovered">&nbsp;20</td>
  <td class="src"><pre class="src">&nbsp;                        firstLine = <span class="keyword">false</span>;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1008</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                        <span class="keyword">try</span> {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1009</td>
  <td class="nbHitsCovered">&nbsp;20</td>
  <td class="src"><pre class="src">&nbsp;                            <span class="keyword">if</span> (showSQL) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1010</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                                logInfo(<span class="string">"DDL="</span>+ddl);</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1011</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                            }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1012</td>
  <td class="nbHitsCovered">&nbsp;20</td>
  <td class="src"><pre class="src">&nbsp;                            getSpringJdbcTemplate().execute(ddl);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1013</td>
  <td class="nbHitsCovered">&nbsp;10</td>
  <td class="src"><pre class="src">&nbsp;                        } <span class="keyword">catch</span> (DataAccessException e) {</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1014</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                            <span class="comment">//log.info("Could not to execute first DDL ("+ddl+"), skipping the rest");</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1015</td>
  <td class="nbHitsCovered">&nbsp;10</td>
  <td class="src"><pre class="src">&nbsp;                            logInfo(<span class="string">"Could not execute first DDL line, skipping the rest: "</span> + e.getMessage() + <span class="string">":"</span> + e.getCause());</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1016</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                            <span class="comment">//e.printStackTrace();</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1017</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                            <span class="keyword">return</span>;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1018</td>
  <td class="nbHitsCovered">&nbsp;10</td>
  <td class="src"><pre class="src">&nbsp;                        }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1019</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                    } <span class="keyword">else</span> {</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1020</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                        <span class="comment">// run other lines, until done - any one can fail (we will report it)</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1021</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                        <span class="keyword">try</span> {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1022</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                            <span class="keyword">if</span> (showSQL) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1023</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                                logInfo(<span class="string">"DDL="</span>+ddl);</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1024</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                            }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1025</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                            getSpringJdbcTemplate().execute(ddl);</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1026</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                        } <span class="keyword">catch</span> (DataAccessException e) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1027</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                            <span class="keyword">throw</span> <span class="keyword">new</span> IllegalArgumentException(<span class="string">"Failed while executing ddl: "</span> + e.getMessage(), e);</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1028</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                        }</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1029</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                    }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1030</td>
  <td class="nbHitsCovered">&nbsp;10</td>
  <td class="src"><pre class="src">&nbsp;                    <span class="keyword">if</span> (isAutoCommitDDL()) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1031</td>
  <td class="nbHitsCovered">&nbsp;4</td>
  <td class="src"><pre class="src">&nbsp;                        commitTransaction();</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1032</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1033</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1034</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                    <span class="comment">// clear the buffer for next</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1035</td>
  <td class="nbHitsCovered">&nbsp;10</td>
  <td class="src"><pre class="src">&nbsp;                    buf.setLength(0);</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1036</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1037</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            } <span class="keyword">catch</span> (IOException any) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1038</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                <span class="keyword">throw</span> <span class="keyword">new</span> RuntimeException(<span class="string">"Failure while processing DDL"</span>, any);</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1039</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            } <span class="keyword">finally</span> {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1040</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                <span class="keyword">try</span> {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1041</td>
  <td class="nbHitsCovered">&nbsp;20</td>
  <td class="src"><pre class="src">&nbsp;                    r.close();</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1042</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                } <span class="keyword">catch</span> (IOException any) {</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1043</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                    <span class="comment">//log.warn("Failure while closing DDL inputstream reader", any);</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1044</td>
  <td class="nbHitsCovered">&nbsp;20</td>
  <td class="src"><pre class="src">&nbsp;                }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1045</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                <span class="comment">// close the connection used for this DDL</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1046</td>
  <td class="nbHitsCovered">&nbsp;20</td>
  <td class="src"><pre class="src">&nbsp;                <span class="keyword">if</span> (isAutoCommitDDL()) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1047</td>
  <td class="nbHitsCovered">&nbsp;4</td>
  <td class="src"><pre class="src">&nbsp;                    closeConnection();</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1048</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1049</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1050</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        } <span class="keyword">finally</span> {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1051</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            <span class="keyword">try</span> {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1052</td>
  <td class="nbHitsCovered">&nbsp;20</td>
  <td class="src"><pre class="src">&nbsp;                sqlDDL.close();</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1053</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            } <span class="keyword">catch</span> (IOException any) {</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1054</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                <span class="comment">//log.warn("Failure while closing inputstream", any);</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1055</td>
  <td class="nbHitsCovered">&nbsp;30</td>
  <td class="src"><pre class="src">&nbsp;            }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1056</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;        }</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1057</td>
  <td class="nbHitsCovered">&nbsp;10</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1058</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1059</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">// *********** SQL methods</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1060</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1061</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1062</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * Make SQL from a template</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1063</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * </span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1064</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param sqlTemplate pass in an SQL template (one of the BASIC_* ones or make your own),</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1065</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * the replacement names will be replaced with the replacement values</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1066</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param tableName the name of the table for this SQL</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1067</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param replacements a sequence of replacement names (probably {@link #COLUMNS}, {@link #WHERE}, etc.) and values,</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1068</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * alternating like so: name,value,name,value</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1069</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @return the SQL with all replacements made</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1070</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1071</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    <span class="keyword">protected</span> String makeSQL(String sqlTemplate, String tableName, String... replacements) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1072</td>
  <td class="nbHitsCovered">&nbsp;1310</td>
  <td class="src"><pre class="src">&nbsp;        String sql = sqlTemplate;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1073</td>
  <td class="nbHitsCovered">&nbsp;1310</td>
  <td class="src"><pre class="src">&nbsp;        sql = sql.replace(StatementMapper.TABLE_NAME, tableName);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1074</td>
  <td class="nbHitsCovered">&nbsp;3810</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">for</span> (<span class="keyword">int</span> i = 0; i &lt; replacements.length; i++) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1075</td>
  <td class="nbHitsCovered">&nbsp;2500</td>
  <td class="src"><pre class="src">&nbsp;            <span class="keyword">if</span> (replacements.length &lt; i + 1) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1076</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                <span class="keyword">break</span>;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1077</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1078</td>
  <td class="nbHitsCovered">&nbsp;2500</td>
  <td class="src"><pre class="src">&nbsp;            sql = sql.replace(replacements[i], replacements[i+1]);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1079</td>
  <td class="nbHitsCovered">&nbsp;2500</td>
  <td class="src"><pre class="src">&nbsp;            i++;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1080</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1081</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        <span class="comment">// put in the select replacement last in case it was already replaced</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1082</td>
  <td class="nbHitsCovered">&nbsp;1310</td>
  <td class="src"><pre class="src">&nbsp;        sql = sql.replace(StatementMapper.SELECT, <span class="string">"*"</span>);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1083</td>
  <td class="nbHitsCovered">&nbsp;1310</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> sql;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1084</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1085</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1086</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1087</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * Handle the replacements of DDL constants in the supplied DDL with real values</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1088</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * based on the supplied type&lt;br/&gt;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1089</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * The following keys will be replaced automatically:&lt;br/&gt;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1090</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * {TABLENAME} - the value returned by {@link #getTableName()}&lt;br/&gt;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1091</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * {ID} - the column name of the unique identifier&lt;br/&gt;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1092</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * {TABLENAME:org.domain.MyClass} - the value returned by {@link #getTableName()} for the persistent type MyClass&lt;br/&gt;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1093</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * {ID:org.domain.MyClass} - the column name of the unique identifier for the persistent type MyClass&lt;br/&gt;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1094</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * {COLUMNNAME:propertyName} - the column name which maps to the propertyName&lt;br/&gt;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1095</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * {IDSEQNAME} - (Oracle) a sequence name will be generated and inserted</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1096</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * based on the table name for use in generating IDs,</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1097</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * if you want to specify your own sequence name then you will lose</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1098</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * the ability to have the ID inserted into newly created objects&lt;br/&gt;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1099</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * </span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1100</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param type a persistent class type</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1101</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param ddl database definition statements (can also be SQL)</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1102</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @return the DDL string with the {vars} replaced</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1103</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1104</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    <span class="keyword">protected</span> String handleTypeReplacements(Class&lt;?&gt; type, String ddl) {</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1105</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        <span class="comment">//StringBuilder sb = new StringBuilder(ddl);</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1106</td>
  <td class="nbHitsCovered">&nbsp;25</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (type == <span class="keyword">null</span> || ddl == <span class="keyword">null</span>) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1107</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            <span class="keyword">throw</span> <span class="keyword">new</span> IllegalArgumentException(<span class="string">"Type and ddl cannot be null"</span>);</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1108</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1109</td>
  <td class="nbHitsCovered">&nbsp;25</td>
  <td class="src"><pre class="src">&nbsp;        String tableName = getTableNameFromClass(type);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1110</td>
  <td class="nbHitsCovered">&nbsp;25</td>
  <td class="src"><pre class="src">&nbsp;        ddl = ddl.replace(DataMapper.DDL_TABLENAME, tableName);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1111</td>
  <td class="nbHitsCovered">&nbsp;25</td>
  <td class="src"><pre class="src">&nbsp;        ddl = ddl.replace(DataMapper.DDL_ID_COLUMN, getIdColumn(type));</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1112</td>
  <td class="nbHitsCovered">&nbsp;25</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (DataMapper.DBTYPE_ORACLE.equals(getDatabaseType())) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1113</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            ddl = ddl.replace(DataMapper.DDL_ID_SEQNAME, OracleTranslator.getOracleSeqName(tableName) );</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1114</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1115</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        <span class="comment">// now check for the other types and handle them if needed</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1116</td>
  <td class="nbHitsCovered">&nbsp;25</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (ddl.contains(DataMapper.DDL_TABLENAME_TYPE_PREFIX)) {</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1117</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            <span class="comment">// resolve the classname for a tablename</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1118</td>
  <td class="nbHitsCovered">&nbsp;11</td>
  <td class="src"><pre class="src">&nbsp;            List&lt;Class&lt;?&gt;&gt; pClasses = getPersistentClasses();</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1119</td>
  <td class="nbHitsCovered">&nbsp;11</td>
  <td class="src"><pre class="src">&nbsp;            <span class="keyword">for</span> (Class&lt;?&gt; pType : pClasses) {</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1120</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                <span class="comment">// attempt to replace all parent tablenames</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1121</td>
  <td class="nbHitsCovered">&nbsp;22</td>
  <td class="src"><pre class="src">&nbsp;                String tName = getTableNameFromClass(pType);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1122</td>
  <td class="nbHitsCovered">&nbsp;22</td>
  <td class="src"><pre class="src">&nbsp;                ddl = ddl.replace(DataMapper.DDL_TABLENAME_TYPE_PREFIX + pType.getName() + <span class="string">"}"</span>, tName);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1123</td>
  <td class="nbHitsCovered">&nbsp;22</td>
  <td class="src"><pre class="src">&nbsp;                ddl = ddl.replace(DataMapper.DDL_TABLENAME_TYPE_PREFIX + pType.getSimpleName() + <span class="string">"}"</span>, tName);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1124</td>
  <td class="nbHitsCovered">&nbsp;22</td>
  <td class="src"><pre class="src">&nbsp;            }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1125</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1126</td>
  <td class="nbHitsCovered">&nbsp;25</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (ddl.contains(DataMapper.DDL_ID_TYPE_PREFIX)) {</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1127</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            <span class="comment">// resolve the classname for a tablename</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1128</td>
  <td class="nbHitsCovered">&nbsp;11</td>
  <td class="src"><pre class="src">&nbsp;            List&lt;Class&lt;?&gt;&gt; pClasses = getPersistentClasses();</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1129</td>
  <td class="nbHitsCovered">&nbsp;11</td>
  <td class="src"><pre class="src">&nbsp;            <span class="keyword">for</span> (Class&lt;?&gt; pType : pClasses) {</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1130</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                <span class="comment">// attempt to replace all parent tablenames</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1131</td>
  <td class="nbHitsCovered">&nbsp;22</td>
  <td class="src"><pre class="src">&nbsp;                String pId = getIdColumn(pType);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1132</td>
  <td class="nbHitsCovered">&nbsp;22</td>
  <td class="src"><pre class="src">&nbsp;                ddl = ddl.replace(DataMapper.DDL_ID_TYPE_PREFIX + pType.getName() + <span class="string">"}"</span>, pId);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1133</td>
  <td class="nbHitsCovered">&nbsp;22</td>
  <td class="src"><pre class="src">&nbsp;                ddl = ddl.replace(DataMapper.DDL_ID_TYPE_PREFIX + pType.getSimpleName() + <span class="string">"}"</span>, pId);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1134</td>
  <td class="nbHitsCovered">&nbsp;22</td>
  <td class="src"><pre class="src">&nbsp;            }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1135</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1136</td>
  <td class="nbHitsCovered">&nbsp;25</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (ddl.contains(DataMapper.DDL_COLUMN_PREFIX)) {</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1137</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            <span class="comment">// resolve the classname for a tablename</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1138</td>
  <td class="nbHitsCovered">&nbsp;2</td>
  <td class="src"><pre class="src">&nbsp;            NamesRecord nr = getNamesRecord(type);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1139</td>
  <td class="nbHitsCovered">&nbsp;2</td>
  <td class="src"><pre class="src">&nbsp;            <span class="keyword">for</span> (String property : nr.getPropertyNames()) {</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1140</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                <span class="comment">// attempt to replace all property names</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1141</td>
  <td class="nbHitsCovered">&nbsp;6</td>
  <td class="src"><pre class="src">&nbsp;                String column = nr.getColumnForProperty(property);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1142</td>
  <td class="nbHitsCovered">&nbsp;6</td>
  <td class="src"><pre class="src">&nbsp;                ddl = ddl.replace(DataMapper.DDL_COLUMN_PREFIX + property + <span class="string">"}"</span>, column);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1143</td>
  <td class="nbHitsCovered">&nbsp;6</td>
  <td class="src"><pre class="src">&nbsp;            }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1144</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            <span class="comment">// TODO support for columns by type?</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1145</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1146</td>
  <td class="nbHitsCovered">&nbsp;25</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> ddl;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1147</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1148</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1149</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1150</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * Create comparison SQL but converts the value object to a string</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1151</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * </span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1152</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param column the name of a database column</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1153</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param comparisonConstant the comparison constant (e.g. EQUALS)</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1154</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param value the value to compare the property to</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1155</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @return a string representing the SQL snippet (e.g. propA = ?)</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1156</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1157</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    <span class="keyword">protected</span> String makeComparisonSQL(String column, <span class="keyword">int</span> comparisonConstant, Object value) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1158</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;        <span class="keyword">return</span> JDBCUtils.makeComparisonSQL(column, comparisonConstant, value);</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1159</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1160</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1161</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1162</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param params a set of params to add this value to</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1163</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param column the name of a database column</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1164</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param comparisonConstant the comparison constant (e.g. EQUALS)</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1165</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param value the value to compare the property to</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1166</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @return a string representing the SQL snippet (e.g. propA = ?)</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1167</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1168</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    <span class="keyword">protected</span> String makeComparisonSQL(List&lt;Object&gt; params, String column, <span class="keyword">int</span> comparisonConstant, Object value) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1169</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;        <span class="keyword">return</span> JDBCUtils.makeComparisonSQL(params, column, comparisonConstant, value);</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1170</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1171</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1172</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1173</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">// ** Transaction methods</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1174</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1175</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1176</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * This will do a commit on the current DB Connection on this thread,</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1177</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * allows the developer to force a commit immediately &lt;br/&gt;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1178</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * Remember to close your connection if you are completely done with it</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1179</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * </span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1180</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @return true if it committed successfully</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1181</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1182</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    <span class="keyword">public</span> <span class="keyword">boolean</span> commitTransaction() {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1183</td>
  <td class="nbHitsCovered">&nbsp;243</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">boolean</span> success = <span class="keyword">false</span>;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1184</td>
  <td class="nbHitsCovered">&nbsp;243</td>
  <td class="src"><pre class="src">&nbsp;        Connection conn = getConnection();</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1185</td>
  <td class="nbHitsCovered">&nbsp;243</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">boolean</span> previousAutocommit = <span class="keyword">false</span>;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1186</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">try</span> {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1187</td>
  <td class="nbHitsCovered">&nbsp;243</td>
  <td class="src"><pre class="src">&nbsp;            previousAutocommit = conn.getAutoCommit();</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1188</td>
  <td class="nbHitsCovered">&nbsp;243</td>
  <td class="src"><pre class="src">&nbsp;            conn.commit();</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1189</td>
  <td class="nbHitsCovered">&nbsp;243</td>
  <td class="src"><pre class="src">&nbsp;            conn.setAutoCommit(previousAutocommit);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1190</td>
  <td class="nbHitsCovered">&nbsp;243</td>
  <td class="src"><pre class="src">&nbsp;            success = <span class="keyword">true</span>;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1191</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;        } <span class="keyword">catch</span> (SQLException e) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1192</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            logWarn(<span class="string">"Could not commit sucessfully: "</span> + e.getMessage());</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1193</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            success = <span class="keyword">false</span>;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1194</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            <span class="keyword">try</span> {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1195</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                conn.setAutoCommit(previousAutocommit);</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1196</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            } <span class="keyword">catch</span> (SQLException e1) {</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1197</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                <span class="comment">// nothing to do here but continue</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1198</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            }</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1199</td>
  <td class="nbHitsCovered">&nbsp;243</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1200</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        <span class="comment">// removed: try-finally-releaseConnection(conn);</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1201</td>
  <td class="nbHitsCovered">&nbsp;243</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> success;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1202</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1203</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1204</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1205</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * This will do a rollback on the DB Connection on this thread,</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1206</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * allows the developer to force an immediate rollback &lt;br/&gt;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1207</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * Remember to close your connection if you are completely done with it</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1208</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * </span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1209</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @return true if the rollback executed successfully</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1210</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1211</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    <span class="keyword">public</span> <span class="keyword">boolean</span> rollbackTransaction() {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1212</td>
  <td class="nbHitsCovered">&nbsp;19</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">boolean</span> success = <span class="keyword">false</span>;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1213</td>
  <td class="nbHitsCovered">&nbsp;19</td>
  <td class="src"><pre class="src">&nbsp;        Connection conn = getConnection();</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1214</td>
  <td class="nbHitsCovered">&nbsp;19</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">boolean</span> previousAutocommit = <span class="keyword">false</span>;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1215</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">try</span> {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1216</td>
  <td class="nbHitsCovered">&nbsp;19</td>
  <td class="src"><pre class="src">&nbsp;            previousAutocommit = conn.getAutoCommit();</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1217</td>
  <td class="nbHitsCovered">&nbsp;19</td>
  <td class="src"><pre class="src">&nbsp;            conn.rollback();</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1218</td>
  <td class="nbHitsCovered">&nbsp;19</td>
  <td class="src"><pre class="src">&nbsp;            conn.setAutoCommit(previousAutocommit);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1219</td>
  <td class="nbHitsCovered">&nbsp;19</td>
  <td class="src"><pre class="src">&nbsp;            success = <span class="keyword">true</span>;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1220</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;        } <span class="keyword">catch</span> (SQLException e) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1221</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            logWarn(<span class="string">"Could not rollback sucessfully: "</span> + e.getMessage());</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1222</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            success = <span class="keyword">false</span>;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1223</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            <span class="keyword">try</span> {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1224</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                conn.setAutoCommit(previousAutocommit);</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1225</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            } <span class="keyword">catch</span> (SQLException e1) {</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1226</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                <span class="comment">// nothing to do here but continue</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1227</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            }</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1228</td>
  <td class="nbHitsCovered">&nbsp;19</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1229</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        <span class="comment">// removed: try-finally-releaseConnection(conn);</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1230</td>
  <td class="nbHitsCovered">&nbsp;19</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> success;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1231</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1232</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1233</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1234</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * Allows a developer to do a manual release of the connection,</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1235</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * this will cause a new connection to be obtained the next time a method is executed,</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1236</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * anything not yet committed for this connection will be rolled back and lost,</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1237</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * normally if you are using a DataSource which pools connections then you do not</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1238</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * need to worry about this too much, just do it at the end of your work unit</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1239</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * </span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1240</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @return true if the connection was closed</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1241</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1242</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    <span class="keyword">public</span> <span class="keyword">boolean</span> closeConnection() {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1243</td>
  <td class="nbHitsCovered">&nbsp;23</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">boolean</span> success = <span class="keyword">false</span>;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1244</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">try</span> {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1245</td>
  <td class="nbHitsCovered">&nbsp;23</td>
  <td class="src"><pre class="src">&nbsp;            Connection conn = getConnection();</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1246</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            <span class="keyword">try</span> {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1247</td>
  <td class="nbHitsCovered">&nbsp;23</td>
  <td class="src"><pre class="src">&nbsp;                conn.rollback();</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1248</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            } <span class="keyword">catch</span> (Exception e) {</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1249</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                <span class="comment">// oh well, keep going</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1250</td>
  <td class="nbHitsCovered">&nbsp;23</td>
  <td class="src"><pre class="src">&nbsp;            }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1251</td>
  <td class="nbHitsCovered">&nbsp;23</td>
  <td class="src"><pre class="src">&nbsp;            DataSourceUtils.doReleaseConnection(conn, getDataSource());</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1252</td>
  <td class="nbHitsCovered">&nbsp;23</td>
  <td class="src"><pre class="src">&nbsp;            success = <span class="keyword">true</span>;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1253</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;        } <span class="keyword">catch</span> (CannotGetJdbcConnectionException e) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1254</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            logWarn(<span class="string">"Could not close connection sucessfully: "</span> + e.getMessage());</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1255</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;        } <span class="keyword">catch</span> (SQLException e) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1256</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            logWarn(<span class="string">"Could not close connection sucessfully: "</span> + e.getMessage());</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1257</td>
  <td class="nbHitsCovered">&nbsp;23</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1258</td>
  <td class="nbHitsCovered">&nbsp;23</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> success;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1259</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1260</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1261</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">// PUBLIC IMPLS</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1262</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1263</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/* (non-Javadoc)</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1264</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @see org.sakaiproject.genericdao.api.GenericDao#getIdProperty(java.lang.Class)</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1265</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1266</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    <span class="keyword">public</span> String getIdProperty(Class&lt;?&gt; type) {</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1267</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        String idProp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1268</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">try</span> {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1269</td>
  <td class="nbHitsCovered">&nbsp;2688</td>
  <td class="src"><pre class="src">&nbsp;            idProp = getNamesRecord(type).getIdProperty();</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1270</td>
  <td class="nbHitsCovered">&nbsp;2683</td>
  <td class="src"><pre class="src">&nbsp;            <span class="keyword">if</span> (idProp == <span class="keyword">null</span> &amp;&amp; classes.contains(type)) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1271</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                idProp = <span class="string">"id"</span>;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1272</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1273</td>
  <td class="nbHitsCovered">&nbsp;5</td>
  <td class="src"><pre class="src">&nbsp;        } <span class="keyword">catch</span> (IllegalArgumentException e) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1274</td>
  <td class="nbHitsCovered">&nbsp;5</td>
  <td class="src"><pre class="src">&nbsp;            idProp = <span class="keyword">null</span>;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1275</td>
  <td class="nbHitsCovered">&nbsp;2683</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1276</td>
  <td class="nbHitsCovered">&nbsp;2688</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> idProp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1277</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1278</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1279</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1280</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * MUST be overridden</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1281</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1282</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    @SuppressWarnings(<span class="string">"unchecked"</span>)</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1283</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    <span class="keyword">protected</span> &lt;T&gt; T baseFindById(Class&lt;T&gt; type, Serializable id) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1284</td>
  <td class="nbHitsCovered">&nbsp;82</td>
  <td class="src"><pre class="src">&nbsp;        String idColumn = getIdColumn(type);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1285</td>
  <td class="nbHitsCovered">&nbsp;82</td>
  <td class="src"><pre class="src">&nbsp;        String sql = makeSQL(getSelectTemplate(type), getTableNameFromClass(type), StatementMapper.WHERE, <span class="string">"where "</span> + getIdColumn(type) + <span class="string">" = ?"</span>);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1286</td>
  <td class="nbHitsCovered">&nbsp;82</td>
  <td class="src"><pre class="src">&nbsp;        T entity = <span class="keyword">null</span>;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1287</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">try</span> {</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1288</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            <span class="comment">// convert the type if needed</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1289</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            <span class="keyword">try</span> {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1290</td>
  <td class="nbHitsCovered">&nbsp;82</td>
  <td class="src"><pre class="src">&nbsp;                id = (Serializable) convertColumn(type, idColumn, id);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1291</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            } <span class="keyword">catch</span> (ClassCastException e) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1292</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                <span class="keyword">throw</span> <span class="keyword">new</span> IllegalArgumentException(<span class="string">"all ids must be Serializable, change the property type defined in the names record for the id to be a Serializable type: "</span> + e.getMessage(), e);</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1293</td>
  <td class="nbHitsCovered">&nbsp;82</td>
  <td class="src"><pre class="src">&nbsp;            }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1294</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            <span class="comment">// get the map of values</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1295</td>
  <td class="nbHitsCovered">&nbsp;82</td>
  <td class="src"><pre class="src">&nbsp;            Object[] params = <span class="keyword">new</span> Object[] {id};</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1296</td>
  <td class="nbHitsCovered">&nbsp;82</td>
  <td class="src"><pre class="src">&nbsp;            <span class="keyword">if</span> (showSQL) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1297</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                logInfo(<span class="string">"SQL="</span>+sql+<span class="string">":\n Params="</span>+ArrayUtils.arrayToString(params));</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1298</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1299</td>
  <td class="nbHitsCovered">&nbsp;82</td>
  <td class="src"><pre class="src">&nbsp;            Map&lt;String, Object&gt; data = getSpringJdbcTemplate().queryForMap(sql, params);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1300</td>
  <td class="nbHitsCovered">&nbsp;63</td>
  <td class="src"><pre class="src">&nbsp;            entity = makeEntityFromMap(type, data);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1301</td>
  <td class="nbHitsCovered">&nbsp;19</td>
  <td class="src"><pre class="src">&nbsp;        } <span class="keyword">catch</span> (IncorrectResultSizeDataAccessException e) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1302</td>
  <td class="nbHitsCovered">&nbsp;19</td>
  <td class="src"><pre class="src">&nbsp;            entity = <span class="keyword">null</span>;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1303</td>
  <td class="nbHitsCovered">&nbsp;63</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1304</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1305</td>
  <td class="nbHitsCovered">&nbsp;82</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> entity;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1306</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1307</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1308</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1309</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * MUST be overridden</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1310</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1311</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    <span class="keyword">protected</span> Serializable baseCreate(Class&lt;?&gt; type, Object object) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1312</td>
  <td class="nbHitsCovered">&nbsp;971</td>
  <td class="src"><pre class="src">&nbsp;        StringBuilder rKeys = <span class="keyword">new</span> StringBuilder();</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1313</td>
  <td class="nbHitsCovered">&nbsp;971</td>
  <td class="src"><pre class="src">&nbsp;        StringBuilder rVals = <span class="keyword">new</span> StringBuilder();</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1314</td>
  <td class="nbHitsCovered">&nbsp;971</td>
  <td class="src"><pre class="src">&nbsp;        ArrayList&lt;Object&gt; replacementValues = <span class="keyword">new</span> ArrayList&lt;Object&gt;();</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1315</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1316</td>
  <td class="nbHitsCovered">&nbsp;971</td>
  <td class="src"><pre class="src">&nbsp;        Map&lt;String, Object&gt; values = makeMapFromEntity(object);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1317</td>
  <td class="nbHitsCovered">&nbsp;971</td>
  <td class="src"><pre class="src">&nbsp;        String idColumn = getIdColumn(type);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1318</td>
  <td class="nbHitsCovered">&nbsp;971</td>
  <td class="src"><pre class="src">&nbsp;        String tableName = getTableNameFromClass(type);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1319</td>
  <td class="nbHitsCovered">&nbsp;971</td>
  <td class="src"><pre class="src">&nbsp;        Object idValue = <span class="keyword">null</span>;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1320</td>
  <td class="nbHitsCovered">&nbsp;971</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">int</span> counter = 0;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1321</td>
  <td class="nbHitsCovered">&nbsp;971</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">for</span> (Entry&lt;String, Object&gt; entry : values.entrySet()) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1322</td>
  <td class="nbHitsCovered">&nbsp;2913</td>
  <td class="src"><pre class="src">&nbsp;            String column = entry.getKey();</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1323</td>
  <td class="nbHitsCovered">&nbsp;2913</td>
  <td class="src"><pre class="src">&nbsp;            Object value = entry.getValue();</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1324</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            <span class="comment">// convert the value if needed</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1325</td>
  <td class="nbHitsCovered">&nbsp;2913</td>
  <td class="src"><pre class="src">&nbsp;            value = convertColumn(type, column, value);</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1326</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            <span class="comment">// handle the id column specially</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1327</td>
  <td class="nbHitsCovered">&nbsp;2913</td>
  <td class="src"><pre class="src">&nbsp;            <span class="keyword">if</span> (idColumn.equals(column)) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1328</td>
  <td class="nbHitsCovered">&nbsp;971</td>
  <td class="src"><pre class="src">&nbsp;                idValue = value;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1329</td>
  <td class="nbHitsCovered">&nbsp;971</td>
  <td class="src"><pre class="src">&nbsp;                <span class="keyword">if</span> (idValue == <span class="keyword">null</span>) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1330</td>
  <td class="nbHitsCovered">&nbsp;966</td>
  <td class="src"><pre class="src">&nbsp;                    <span class="keyword">continue</span>; <span class="comment">// expect to autogenerate an id</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1331</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1332</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                <span class="comment">// id was specified so use that instead of autogenerating</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1333</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1334</td>
  <td class="nbHitsCovered">&nbsp;1947</td>
  <td class="src"><pre class="src">&nbsp;            <span class="keyword">if</span> (counter &gt; 0) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1335</td>
  <td class="nbHitsCovered">&nbsp;976</td>
  <td class="src"><pre class="src">&nbsp;                rKeys.append(<span class="string">","</span>);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1336</td>
  <td class="nbHitsCovered">&nbsp;976</td>
  <td class="src"><pre class="src">&nbsp;                rVals.append(<span class="string">","</span>);</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1337</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1338</td>
  <td class="nbHitsCovered">&nbsp;1947</td>
  <td class="src"><pre class="src">&nbsp;            rKeys.append(column);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1339</td>
  <td class="nbHitsCovered">&nbsp;1947</td>
  <td class="src"><pre class="src">&nbsp;            rVals.append(<span class="string">"?"</span>);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1340</td>
  <td class="nbHitsCovered">&nbsp;1947</td>
  <td class="src"><pre class="src">&nbsp;            replacementValues.add(value);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1341</td>
  <td class="nbHitsCovered">&nbsp;1947</td>
  <td class="src"><pre class="src">&nbsp;            counter++;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1342</td>
  <td class="nbHitsCovered">&nbsp;1947</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1343</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1344</td>
  <td class="nbHitsCovered">&nbsp;971</td>
  <td class="src"><pre class="src">&nbsp;        String sql = makeSQL(getInsertTemplate(type), tableName, StatementMapper.COLUMNS, rKeys.toString(), </pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1345</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                StatementMapper.VALUES, rVals.toString());</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1346</td>
  <td class="nbHitsCovered">&nbsp;971</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (showSQL) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1347</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            logInfo(<span class="string">"SQL="</span>+sql+<span class="string">":\n Params="</span>+replacementValues);</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1348</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1349</td>
  <td class="nbHitsCovered">&nbsp;971</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">int</span> rows = getSpringJdbcTemplate().update(sql, replacementValues.toArray(<span class="keyword">new</span> Object[replacementValues.size()]));</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1350</td>
  <td class="nbHitsCovered">&nbsp;966</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (rows &lt;= 0) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1351</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            <span class="keyword">throw</span> <span class="keyword">new</span> RuntimeException(<span class="string">"Could not create DB insert based on object: "</span> + object);</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1352</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1353</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1354</td>
  <td class="nbHitsCovered">&nbsp;966</td>
  <td class="src"><pre class="src">&nbsp;        String idProperty = getIdProperty(type);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1355</td>
  <td class="nbHitsCovered">&nbsp;966</td>
  <td class="src"><pre class="src">&nbsp;        Class&lt;?&gt; idType = ReflectUtils.getInstance().getFieldType(type, idProperty);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1356</td>
  <td class="nbHitsCovered">&nbsp;966</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (idValue == <span class="keyword">null</span>) {</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1357</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            <span class="comment">// now get the new id and put it in the object</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1358</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            <span class="keyword">try</span> {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1359</td>
  <td class="nbHitsCovered">&nbsp;966</td>
  <td class="src"><pre class="src">&nbsp;                String idSQL = getDatabaseTranslator().makeAutoIdQuery(tableName, idColumn);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1360</td>
  <td class="nbHitsCovered">&nbsp;966</td>
  <td class="src"><pre class="src">&nbsp;                <span class="keyword">if</span> (showSQL) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1361</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                    logInfo(<span class="string">"SQL="</span>+idSQL);</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1362</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1363</td>
  <td class="nbHitsCovered">&nbsp;966</td>
  <td class="src"><pre class="src">&nbsp;                idValue = getSpringJdbcTemplate().queryForObject(idSQL, idType);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1364</td>
  <td class="nbHitsCovered">&nbsp;966</td>
  <td class="src"><pre class="src">&nbsp;                <span class="keyword">if</span> (idValue == <span class="keyword">null</span>) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1365</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                    <span class="keyword">throw</span> <span class="keyword">new</span> NullPointerException(<span class="string">"Null value for new id retrieved from DB"</span>);</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1366</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1367</td>
  <td class="nbHitsCovered">&nbsp;966</td>
  <td class="src"><pre class="src">&nbsp;                ReflectUtils.getInstance().setFieldValue(object, idProperty, idValue);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1368</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            } <span class="keyword">catch</span> (RuntimeException e) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1369</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                <span class="keyword">throw</span> <span class="keyword">new</span> IllegalStateException(<span class="string">"Could not get back the autogenerated ID of the newly inserted object: "</span> + object + <span class="string">" :"</span> + e.getMessage(), e);</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1370</td>
  <td class="nbHitsCovered">&nbsp;966</td>
  <td class="src"><pre class="src">&nbsp;            }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1371</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1372</td>
  <td class="nbHitsCovered">&nbsp;966</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (! Serializable.<span class="keyword">class</span>.isAssignableFrom(idValue.getClass())) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1373</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            idValue = idValue.toString();</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1374</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1375</td>
  <td class="nbHitsCovered">&nbsp;966</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> (Serializable) idValue;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1376</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1377</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1378</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1379</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * MUST be overridden</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1380</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1381</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    <span class="keyword">protected</span> <span class="keyword">void</span> baseUpdate(Class&lt;?&gt; type, Object id, Object object) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1382</td>
  <td class="nbHitsCovered">&nbsp;18</td>
  <td class="src"><pre class="src">&nbsp;        String idColumn = getIdColumn(type);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1383</td>
  <td class="nbHitsCovered">&nbsp;18</td>
  <td class="src"><pre class="src">&nbsp;        StringBuilder update = <span class="keyword">new</span> StringBuilder();</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1384</td>
  <td class="nbHitsCovered">&nbsp;18</td>
  <td class="src"><pre class="src">&nbsp;        ArrayList&lt;Object&gt; replacementValues = <span class="keyword">new</span> ArrayList&lt;Object&gt;();</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1385</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1386</td>
  <td class="nbHitsCovered">&nbsp;18</td>
  <td class="src"><pre class="src">&nbsp;        Map&lt;String, Object&gt; values = makeMapFromEntity(object);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1387</td>
  <td class="nbHitsCovered">&nbsp;18</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">int</span> counter = 0;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1388</td>
  <td class="nbHitsCovered">&nbsp;18</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">for</span> (Entry&lt;String, Object&gt; entry : values.entrySet()) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1389</td>
  <td class="nbHitsCovered">&nbsp;54</td>
  <td class="src"><pre class="src">&nbsp;            String column = entry.getKey();</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1390</td>
  <td class="nbHitsCovered">&nbsp;54</td>
  <td class="src"><pre class="src">&nbsp;            Object value = entry.getValue();</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1391</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            <span class="comment">// convert the value if needed</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1392</td>
  <td class="nbHitsCovered">&nbsp;54</td>
  <td class="src"><pre class="src">&nbsp;            value = convertColumn(type, column, value);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1393</td>
  <td class="nbHitsCovered">&nbsp;54</td>
  <td class="src"><pre class="src">&nbsp;            <span class="keyword">if</span> (idColumn.equals(column)) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1394</td>
  <td class="nbHitsCovered">&nbsp;18</td>
  <td class="src"><pre class="src">&nbsp;                <span class="keyword">continue</span>; <span class="comment">// skip the id on the first pass</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1395</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1396</td>
  <td class="nbHitsCovered">&nbsp;36</td>
  <td class="src"><pre class="src">&nbsp;            <span class="keyword">if</span> (counter &gt; 0) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1397</td>
  <td class="nbHitsCovered">&nbsp;18</td>
  <td class="src"><pre class="src">&nbsp;                update.append(<span class="string">","</span>);</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1398</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1399</td>
  <td class="nbHitsCovered">&nbsp;36</td>
  <td class="src"><pre class="src">&nbsp;            update.append(column);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1400</td>
  <td class="nbHitsCovered">&nbsp;36</td>
  <td class="src"><pre class="src">&nbsp;            update.append(<span class="string">"=?"</span>);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1401</td>
  <td class="nbHitsCovered">&nbsp;36</td>
  <td class="src"><pre class="src">&nbsp;            replacementValues.add(value);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1402</td>
  <td class="nbHitsCovered">&nbsp;36</td>
  <td class="src"><pre class="src">&nbsp;            counter++;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1403</td>
  <td class="nbHitsCovered">&nbsp;36</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1404</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        <span class="comment">// add the id in at the end</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1405</td>
  <td class="nbHitsCovered">&nbsp;18</td>
  <td class="src"><pre class="src">&nbsp;        replacementValues.add(id);</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1406</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1407</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        <span class="comment">// do the update</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1408</td>
  <td class="nbHitsCovered">&nbsp;18</td>
  <td class="src"><pre class="src">&nbsp;        String sql = makeSQL(getUpdateTemplate(type), getTableNameFromClass(type), </pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1409</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                StatementMapper.UPDATE, update.toString(), StatementMapper.WHERE, <span class="string">"where "</span> + idColumn + <span class="string">" = ?"</span>);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1410</td>
  <td class="nbHitsCovered">&nbsp;18</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (showSQL) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1411</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            logInfo(<span class="string">"SQL="</span>+sql+<span class="string">":\n Params="</span>+replacementValues);</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1412</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1413</td>
  <td class="nbHitsCovered">&nbsp;18</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">int</span> rows = getSpringJdbcTemplate().update(sql, replacementValues.toArray(<span class="keyword">new</span> Object[replacementValues.size()]));</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1414</td>
  <td class="nbHitsCovered">&nbsp;18</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (rows &lt;= 0) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1415</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            <span class="keyword">throw</span> <span class="keyword">new</span> RuntimeException(<span class="string">"Could not update entity based on object: "</span> + object);</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1416</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1417</td>
  <td class="nbHitsCovered">&nbsp;18</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1418</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1419</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1420</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * MUST be overridden</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1421</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1422</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    <span class="keyword">protected</span> &lt;T&gt; <span class="keyword">boolean</span> baseDelete(Class&lt;T&gt; type, Serializable id) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1423</td>
  <td class="nbHitsCovered">&nbsp;24</td>
  <td class="src"><pre class="src">&nbsp;        String idColumn = getIdColumn(type);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1424</td>
  <td class="nbHitsCovered">&nbsp;24</td>
  <td class="src"><pre class="src">&nbsp;        String sql = makeSQL(getDeleteTemplate(type), getTableNameFromClass(type), </pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1425</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                StatementMapper.WHERE, <span class="string">"where "</span> + idColumn + <span class="string">" = ?"</span>);</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1426</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        <span class="comment">// convert the type if needed</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1427</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">try</span> {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1428</td>
  <td class="nbHitsCovered">&nbsp;24</td>
  <td class="src"><pre class="src">&nbsp;            id = (Serializable) convertColumn(type, idColumn, id);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1429</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;        } <span class="keyword">catch</span> (ClassCastException e) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1430</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            <span class="keyword">throw</span> <span class="keyword">new</span> IllegalArgumentException(<span class="string">"all ids must be Serializable, change the property type defined in the names record for the id to be a Serializable type: "</span> + e.getMessage(), e);</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1431</td>
  <td class="nbHitsCovered">&nbsp;24</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1432</td>
  <td class="nbHitsCovered">&nbsp;24</td>
  <td class="src"><pre class="src">&nbsp;        Object[] params = <span class="keyword">new</span> Object[] {id};</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1433</td>
  <td class="nbHitsCovered">&nbsp;24</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (showSQL) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1434</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            logInfo(<span class="string">"SQL="</span>+sql+<span class="string">":\n Params="</span>+ArrayUtils.arrayToString(params));</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1435</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1436</td>
  <td class="nbHitsCovered">&nbsp;24</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">int</span> rows = getSpringJdbcTemplate().update(sql, params);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1437</td>
  <td class="nbHitsCovered">&nbsp;24</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> rows &gt; 0;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1438</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1439</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1440</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1441</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1442</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * Override this if desired</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1443</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1444</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    <span class="keyword">protected</span> Serializable baseGetIdValue(Object object) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1445</td>
  <td class="nbHitsCovered">&nbsp;335</td>
  <td class="src"><pre class="src">&nbsp;        Class&lt;?&gt; type = object.getClass();</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1446</td>
  <td class="nbHitsCovered">&nbsp;330</td>
  <td class="src"><pre class="src">&nbsp;        String idProp = getIdProperty(type);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1447</td>
  <td class="nbHitsCovered">&nbsp;330</td>
  <td class="src"><pre class="src">&nbsp;        Object idValue = <span class="keyword">null</span>;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1448</td>
  <td class="nbHitsCovered">&nbsp;330</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (idProp == <span class="keyword">null</span>) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1449</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            <span class="keyword">throw</span> <span class="keyword">new</span> IllegalArgumentException(<span class="string">"Could not find id property for this class type: "</span> + type);</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1450</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        } <span class="keyword">else</span> {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1451</td>
  <td class="nbHitsCovered">&nbsp;330</td>
  <td class="src"><pre class="src">&nbsp;            idValue = ReflectUtils.getInstance().getFieldValue(object, idProp);</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1452</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1453</td>
  <td class="nbHitsCovered">&nbsp;330</td>
  <td class="src"><pre class="src">&nbsp;        Serializable serialId = <span class="keyword">null</span>;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1454</td>
  <td class="nbHitsCovered">&nbsp;330</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (idValue != <span class="keyword">null</span>) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1455</td>
  <td class="nbHitsCovered">&nbsp;297</td>
  <td class="src"><pre class="src">&nbsp;            <span class="keyword">if</span> (idValue <span class="keyword">instanceof</span> Serializable) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1456</td>
  <td class="nbHitsCovered">&nbsp;297</td>
  <td class="src"><pre class="src">&nbsp;                serialId = (Serializable) idValue;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1457</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            } <span class="keyword">else</span> {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1458</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                serialId = idValue.toString();</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1459</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1460</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1461</td>
  <td class="nbHitsCovered">&nbsp;330</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> serialId;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1462</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1463</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1464</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1465</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * Find the class type of a persistent object,</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1466</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * needed in the case that we are working with something that wraps it's objects&lt;br/&gt;</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1467</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * Override this if desired</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1468</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param entity a persistent entity</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1469</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @return the persistent class type OR null if it cannot be found</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1470</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1471</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    <span class="keyword">protected</span> Class&lt;?&gt; findClass(Object entity) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1472</td>
  <td class="nbHitsCovered">&nbsp;1063</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (entity == <span class="keyword">null</span>) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1473</td>
  <td class="nbHitsCovered">&nbsp;5</td>
  <td class="src"><pre class="src">&nbsp;            <span class="keyword">throw</span> <span class="keyword">new</span> IllegalArgumentException(<span class="string">"Cannot find class type of null entity object"</span>);</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1474</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1475</td>
  <td class="nbHitsCovered">&nbsp;1058</td>
  <td class="src"><pre class="src">&nbsp;        Class&lt;?&gt; type = entity.getClass();</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1476</td>
  <td class="nbHitsCovered">&nbsp;1058</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> type;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1477</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1478</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1479</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">// COMMON CODE</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1480</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1481</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="keyword">private</span> List&lt;Class&lt;?&gt;&gt; classes;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1482</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1483</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * This does a nice bit of exception handling for us and verifies that</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1484</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * this class is valid to perform a DAO operation with</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1485</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param type class type of the persistent object to check</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1486</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @return A valid entityClass type resolved to be the same as</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1487</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * the ones usable by this DAO</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1488</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1489</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    <span class="keyword">protected</span> Class&lt;?&gt; checkClass(Class&lt;?&gt; type) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1490</td>
  <td class="nbHitsCovered">&nbsp;1417</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (type == <span class="keyword">null</span>) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1491</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            <span class="keyword">throw</span> <span class="keyword">new</span> NullPointerException(<span class="string">"type cannot be null"</span>);</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1492</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1493</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1494</td>
  <td class="nbHitsCovered">&nbsp;1417</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (classes == <span class="keyword">null</span>) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1495</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            <span class="keyword">throw</span> <span class="keyword">new</span> NullPointerException(<span class="string">"persistent classes must be set"</span>);</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1496</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1497</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1498</td>
  <td class="nbHitsCovered">&nbsp;1417</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">for</span> (Iterator&lt;Class&lt;?&gt;&gt; i = classes.iterator(); i.hasNext();) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1499</td>
  <td class="nbHitsCovered">&nbsp;1638</td>
  <td class="src"><pre class="src">&nbsp;            Class&lt;?&gt; concrete = (Class&lt;?&gt;) i.next();</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1500</td>
  <td class="nbHitsCovered">&nbsp;1638</td>
  <td class="src"><pre class="src">&nbsp;            <span class="keyword">if</span> (concrete.isAssignableFrom(type)) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1501</td>
  <td class="nbHitsCovered">&nbsp;1405</td>
  <td class="src"><pre class="src">&nbsp;                <span class="keyword">return</span> concrete;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1502</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1503</td>
  <td class="nbHitsCovered">&nbsp;233</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1504</td>
  <td class="nbHitsCovered">&nbsp;12</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">throw</span> <span class="keyword">new</span> IllegalArgumentException(<span class="string">"Could not resolve this class "</span> + </pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1505</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                type + <span class="string">" as part of the set of persistent objects: "</span> +</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1506</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                classes.toString());</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1507</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1508</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1509</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="keyword">private</span> CacheProvider cacheProvider;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1510</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1511</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @return the current cache provider</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1512</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1513</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    <span class="keyword">protected</span> CacheProvider getCacheProvider() {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1514</td>
  <td class="nbHitsCovered">&nbsp;1885</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (cacheProvider == <span class="keyword">null</span>) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1515</td>
  <td class="nbHitsCovered">&nbsp;8</td>
  <td class="src"><pre class="src">&nbsp;            cacheProvider = <span class="keyword">new</span> NonCachingCacheProvider();</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1516</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1517</td>
  <td class="nbHitsCovered">&nbsp;1885</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> cacheProvider;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1518</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1519</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1520</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * Set the cache provider to an implementation of {@link CacheProvider},</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1521</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * this will be set to {@link NonCachingCacheProvider} if this is not set explicitly</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1522</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param cacheProvider</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1523</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1524</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    <span class="keyword">public</span> <span class="keyword">void</span> setCacheProvider(CacheProvider cacheProvider) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1525</td>
  <td class="nbHitsCovered">&nbsp;3</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">this</span>.cacheProvider = cacheProvider;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1526</td>
  <td class="nbHitsCovered">&nbsp;3</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1527</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1528</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @return the cache name used for storing this type of persistent object</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1529</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1530</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    <span class="keyword">protected</span> String getCacheName(Class&lt;?&gt; type) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1531</td>
  <td class="nbHitsCovered">&nbsp;279</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (type == <span class="keyword">null</span>) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1532</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            <span class="keyword">throw</span> <span class="keyword">new</span> IllegalArgumentException(<span class="string">"type cannot be null"</span>);</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1533</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1534</td>
  <td class="nbHitsCovered">&nbsp;279</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> type.getName();</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1535</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1536</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1537</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @return the cachename used for storing search results for this type of object</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1538</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1539</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    <span class="keyword">protected</span> String getSearchCacheName(Class&lt;?&gt; type) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1540</td>
  <td class="nbHitsCovered">&nbsp;1204</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (type == <span class="keyword">null</span>) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1541</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            <span class="keyword">throw</span> <span class="keyword">new</span> IllegalArgumentException(<span class="string">"type cannot be null"</span>);</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1542</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1543</td>
  <td class="nbHitsCovered">&nbsp;1204</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> <span class="string">"search:"</span> + type.getName();</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1544</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1545</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1546</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * Creates all the caches for the current set of persistent types,</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1547</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * this should be called in the init for the generic dao being used after persistent classes are loaded</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1548</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1549</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    <span class="keyword">protected</span> <span class="keyword">void</span> initCaches() {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1550</td>
  <td class="nbHitsCovered">&nbsp;11</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">for</span> (Class&lt;?&gt; type : classes) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1551</td>
  <td class="nbHitsCovered">&nbsp;20</td>
  <td class="src"><pre class="src">&nbsp;            getCacheProvider().createCache(getCacheName(type));</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1552</td>
  <td class="nbHitsCovered">&nbsp;20</td>
  <td class="src"><pre class="src">&nbsp;            getCacheProvider().createCache(getSearchCacheName(type));</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1553</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1554</td>
  <td class="nbHitsCovered">&nbsp;11</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1555</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1556</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">// INTERCEPTOR methods</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1557</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1558</td>
  <td class="nbHitsCovered">&nbsp;18</td>
  <td class="src"><pre class="src">&nbsp;    <span class="keyword">private</span> Map&lt;Class&lt;?&gt;, ReadInterceptor&gt; readInterceptors = <span class="keyword">new</span> ConcurrentHashMap&lt;Class&lt;?&gt;, ReadInterceptor&gt;();</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1559</td>
  <td class="nbHitsCovered">&nbsp;18</td>
  <td class="src"><pre class="src">&nbsp;    <span class="keyword">private</span> Map&lt;Class&lt;?&gt;, WriteInterceptor&gt; writeInterceptors = <span class="keyword">new</span> ConcurrentHashMap&lt;Class&lt;?&gt;, WriteInterceptor&gt;();</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1560</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1561</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * Adds the provided interceptor to the current set of interceptors</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1562</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param interceptor</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1563</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1564</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    <span class="keyword">public</span> <span class="keyword">void</span> addInterceptor(DaoOperationInterceptor interceptor) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1565</td>
  <td class="nbHitsCovered">&nbsp;7</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (interceptor != <span class="keyword">null</span>) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1566</td>
  <td class="nbHitsCovered">&nbsp;7</td>
  <td class="src"><pre class="src">&nbsp;            Class&lt;?&gt; type = interceptor.interceptType();</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1567</td>
  <td class="nbHitsCovered">&nbsp;7</td>
  <td class="src"><pre class="src">&nbsp;            <span class="keyword">if</span> (type != <span class="keyword">null</span>) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1568</td>
  <td class="nbHitsCovered">&nbsp;7</td>
  <td class="src"><pre class="src">&nbsp;                <span class="keyword">if</span> (ReadInterceptor.<span class="keyword">class</span>.isAssignableFrom(interceptor.getClass())) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1569</td>
  <td class="nbHitsCovered">&nbsp;7</td>
  <td class="src"><pre class="src">&nbsp;                    readInterceptors.put(type, (ReadInterceptor) interceptor);</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1570</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1571</td>
  <td class="nbHitsCovered">&nbsp;7</td>
  <td class="src"><pre class="src">&nbsp;                <span class="keyword">if</span> (WriteInterceptor.<span class="keyword">class</span>.isAssignableFrom(interceptor.getClass())) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1572</td>
  <td class="nbHitsCovered">&nbsp;7</td>
  <td class="src"><pre class="src">&nbsp;                    writeInterceptors.put(type, (WriteInterceptor) interceptor);</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1573</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1574</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1575</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1576</td>
  <td class="nbHitsCovered">&nbsp;7</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1577</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1578</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * Removes the provided interceptor from the current set of interceptors</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1579</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param interceptor</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1580</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1581</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    <span class="keyword">public</span> <span class="keyword">void</span> removeInterceptor(DaoOperationInterceptor interceptor) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1582</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;        <span class="keyword">if</span> (interceptor != <span class="keyword">null</span>) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1583</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            Class&lt;?&gt; type = interceptor.interceptType();</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1584</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            <span class="keyword">if</span> (type != <span class="keyword">null</span>) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1585</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                <span class="keyword">if</span> (ReadInterceptor.<span class="keyword">class</span>.isAssignableFrom(interceptor.getClass())) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1586</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                    readInterceptors.remove(type);</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1587</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1588</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                <span class="keyword">if</span> (WriteInterceptor.<span class="keyword">class</span>.isAssignableFrom(interceptor.getClass())) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1589</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;                    writeInterceptors.remove(type);</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1590</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;                }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1591</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1592</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1593</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    }</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1594</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1595</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * Makes the given interceptor the only active interceptor,</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1596</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * removes all others and adds only this one</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1597</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param interceptor</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1598</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1599</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    <span class="keyword">public</span> <span class="keyword">void</span> setInterceptor(DaoOperationInterceptor interceptor) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1600</td>
  <td class="nbHitsCovered">&nbsp;7</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (interceptor != <span class="keyword">null</span>) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1601</td>
  <td class="nbHitsCovered">&nbsp;7</td>
  <td class="src"><pre class="src">&nbsp;            readInterceptors.clear();</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1602</td>
  <td class="nbHitsCovered">&nbsp;7</td>
  <td class="src"><pre class="src">&nbsp;            writeInterceptors.clear();</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1603</td>
  <td class="nbHitsCovered">&nbsp;7</td>
  <td class="src"><pre class="src">&nbsp;            addInterceptor(interceptor);</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1604</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1605</td>
  <td class="nbHitsCovered">&nbsp;7</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1606</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1607</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    <span class="keyword">protected</span> <span class="keyword">void</span> beforeRead(String operation, Class&lt;?&gt; type, Serializable[] ids, Search search) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1608</td>
  <td class="nbHitsCovered">&nbsp;177</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (type != <span class="keyword">null</span>) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1609</td>
  <td class="nbHitsCovered">&nbsp;177</td>
  <td class="src"><pre class="src">&nbsp;            ReadInterceptor interceptor = readInterceptors.get(type);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1610</td>
  <td class="nbHitsCovered">&nbsp;177</td>
  <td class="src"><pre class="src">&nbsp;            <span class="keyword">if</span> (interceptor != <span class="keyword">null</span>) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1611</td>
  <td class="nbHitsCovered">&nbsp;101</td>
  <td class="src"><pre class="src">&nbsp;                interceptor.beforeRead(operation, ids, search);</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1612</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1613</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1614</td>
  <td class="nbHitsCovered">&nbsp;177</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1615</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1616</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    <span class="keyword">protected</span> <span class="keyword">void</span> afterRead(String operation, Class&lt;?&gt; type, Serializable[] ids, Search search, Object[] entities) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1617</td>
  <td class="nbHitsCovered">&nbsp;170</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (type != <span class="keyword">null</span>) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1618</td>
  <td class="nbHitsCovered">&nbsp;170</td>
  <td class="src"><pre class="src">&nbsp;            ReadInterceptor interceptor = readInterceptors.get(type);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1619</td>
  <td class="nbHitsCovered">&nbsp;170</td>
  <td class="src"><pre class="src">&nbsp;            <span class="keyword">if</span> (interceptor != <span class="keyword">null</span>) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1620</td>
  <td class="nbHitsCovered">&nbsp;97</td>
  <td class="src"><pre class="src">&nbsp;                interceptor.afterRead(operation, ids, search, entities);</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1621</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1622</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1623</td>
  <td class="nbHitsCovered">&nbsp;170</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1624</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1625</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    <span class="keyword">protected</span> <span class="keyword">void</span> beforeWrite(String operation, Class&lt;?&gt; type, Serializable[] ids, Object[] entities) {</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1626</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        <span class="comment">// first handle autocommit</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1627</td>
  <td class="nbHitsCovered">&nbsp;1043</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (isAutoCommitOperations()) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1628</td>
  <td class="nbHitsCovered">&nbsp;118</td>
  <td class="src"><pre class="src">&nbsp;            commitTransaction();</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1629</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1630</td>
  <td class="nbHitsCovered">&nbsp;1043</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (type != <span class="keyword">null</span>) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1631</td>
  <td class="nbHitsCovered">&nbsp;1043</td>
  <td class="src"><pre class="src">&nbsp;            WriteInterceptor interceptor = writeInterceptors.get(type);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1632</td>
  <td class="nbHitsCovered">&nbsp;1043</td>
  <td class="src"><pre class="src">&nbsp;            <span class="keyword">if</span> (interceptor != <span class="keyword">null</span>) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1633</td>
  <td class="nbHitsCovered">&nbsp;551</td>
  <td class="src"><pre class="src">&nbsp;                interceptor.beforeWrite(operation, ids, entities);</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1634</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1635</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1636</td>
  <td class="nbHitsCovered">&nbsp;1043</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1637</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1638</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    <span class="keyword">protected</span> <span class="keyword">void</span> afterWrite(String operation, Class&lt;?&gt; type, Serializable[] ids, Object[] entities, <span class="keyword">int</span> changes) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1639</td>
  <td class="nbHitsCovered">&nbsp;1032</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (type != <span class="keyword">null</span>) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1640</td>
  <td class="nbHitsCovered">&nbsp;1032</td>
  <td class="src"><pre class="src">&nbsp;            WriteInterceptor interceptor = writeInterceptors.get(type);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1641</td>
  <td class="nbHitsCovered">&nbsp;1032</td>
  <td class="src"><pre class="src">&nbsp;            <span class="keyword">if</span> (interceptor != <span class="keyword">null</span>) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1642</td>
  <td class="nbHitsCovered">&nbsp;544</td>
  <td class="src"><pre class="src">&nbsp;                interceptor.afterWrite(operation, ids, entities, changes);</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1643</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1644</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1645</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        <span class="comment">// finally handle autocommit</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1646</td>
  <td class="nbHitsCovered">&nbsp;1032</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (isAutoCommitOperations()) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1647</td>
  <td class="nbHitsCovered">&nbsp;116</td>
  <td class="src"><pre class="src">&nbsp;            commitTransaction();</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1648</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1649</td>
  <td class="nbHitsCovered">&nbsp;1032</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1650</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1651</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">// ********* PUBLIC methods ****************</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1652</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1653</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1654</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/* (non-Javadoc)</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1655</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @see org.sakaiproject.genericdao.api.GenericDao#getPersistentClasses()</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1656</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1657</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    <span class="keyword">public</span> List&lt;Class&lt;?&gt;&gt; getPersistentClasses() {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1658</td>
  <td class="nbHitsCovered">&nbsp;3110</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> <span class="keyword">new</span> ArrayList&lt;Class&lt;?&gt;&gt;(classes);</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1659</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1660</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1661</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/* (non-Javadoc)</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1662</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @see org.sakaiproject.genericdao.api.GenericDao#invokeTransactionalAccess(java.lang.Runnable)</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1663</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1664</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    <span class="keyword">public</span> <span class="keyword">void</span> invokeTransactionalAccess(Runnable toinvoke) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1665</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;        toinvoke.run();</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1666</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    }</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1667</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1668</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/* (non-Javadoc)</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1669</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @see org.sakaiproject.genericdao.api.GenericDao#findById(java.lang.Class, java.io.Serializable)</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1670</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1671</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    @SuppressWarnings(<span class="string">"unchecked"</span>)</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1672</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    <span class="keyword">public</span> &lt;T&gt; T findById(Class&lt;T&gt; type, Serializable id) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1673</td>
  <td class="nbHitsCovered">&nbsp;88</td>
  <td class="src"><pre class="src">&nbsp;        checkClass(type);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1674</td>
  <td class="nbHitsCovered">&nbsp;88</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (id == <span class="keyword">null</span>) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1675</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            <span class="keyword">throw</span> <span class="keyword">new</span> IllegalArgumentException(<span class="string">"id must be set to find persistent object"</span>);</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1676</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1677</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1678</td>
  <td class="nbHitsCovered">&nbsp;88</td>
  <td class="src"><pre class="src">&nbsp;        T entity = <span class="keyword">null</span>;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1679</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        <span class="comment">// check cache first</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1680</td>
  <td class="nbHitsCovered">&nbsp;88</td>
  <td class="src"><pre class="src">&nbsp;        String key = id.toString();</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1681</td>
  <td class="nbHitsCovered">&nbsp;88</td>
  <td class="src"><pre class="src">&nbsp;        String cacheName = getCacheName(type);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1682</td>
  <td class="nbHitsCovered">&nbsp;88</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (getCacheProvider().exists(cacheName, key)) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1683</td>
  <td class="nbHitsCovered">&nbsp;6</td>
  <td class="src"><pre class="src">&nbsp;            entity = (T) getCacheProvider().get(cacheName, key);</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1684</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        } <span class="keyword">else</span> {</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1685</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            <span class="comment">// not in cache so go to the DB</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1686</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1687</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            <span class="comment">// before interceptor</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1688</td>
  <td class="nbHitsCovered">&nbsp;82</td>
  <td class="src"><pre class="src">&nbsp;            String operation = <span class="string">"findById"</span>;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1689</td>
  <td class="nbHitsCovered">&nbsp;82</td>
  <td class="src"><pre class="src">&nbsp;            beforeRead(operation, type, <span class="keyword">new</span> Serializable[] {id}, <span class="keyword">null</span>);</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1690</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1691</td>
  <td class="nbHitsCovered">&nbsp;82</td>
  <td class="src"><pre class="src">&nbsp;            entity = baseFindById(type, id);</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1692</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1693</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            <span class="comment">// now put the item in the cache</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1694</td>
  <td class="nbHitsCovered">&nbsp;82</td>
  <td class="src"><pre class="src">&nbsp;            getCacheProvider().put(cacheName, key, entity);</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1695</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1696</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            <span class="comment">// after interceptor</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1697</td>
  <td class="nbHitsCovered">&nbsp;82</td>
  <td class="src"><pre class="src">&nbsp;            afterRead(operation, type, <span class="keyword">new</span> Serializable[] {id}, <span class="keyword">null</span>, <span class="keyword">new</span> Object[] {entity});</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1698</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1699</td>
  <td class="nbHitsCovered">&nbsp;88</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> entity;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1700</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1701</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1702</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/* (non-Javadoc)</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1703</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @see org.sakaiproject.genericdao.api.modifiers.BasicModifier#create(java.lang.Object)</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1704</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1705</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    <span class="keyword">public</span> <span class="keyword">void</span> create(Object object) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1706</td>
  <td class="nbHitsCovered">&nbsp;971</td>
  <td class="src"><pre class="src">&nbsp;        Class&lt;?&gt; type = findClass(object);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1707</td>
  <td class="nbHitsCovered">&nbsp;971</td>
  <td class="src"><pre class="src">&nbsp;        checkClass(type);</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1708</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1709</td>
  <td class="nbHitsCovered">&nbsp;971</td>
  <td class="src"><pre class="src">&nbsp;        String operation = <span class="string">"create"</span>;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1710</td>
  <td class="nbHitsCovered">&nbsp;971</td>
  <td class="src"><pre class="src">&nbsp;        beforeWrite(operation, type, <span class="keyword">null</span>, <span class="keyword">new</span> Object[] {object});</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1711</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1712</td>
  <td class="nbHitsCovered">&nbsp;971</td>
  <td class="src"><pre class="src">&nbsp;        Serializable idValue = baseCreate(type, object);</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1713</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1714</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        <span class="comment">// clear the search caches</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1715</td>
  <td class="nbHitsCovered">&nbsp;966</td>
  <td class="src"><pre class="src">&nbsp;        getCacheProvider().clear(getSearchCacheName(type));</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1716</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1717</td>
  <td class="nbHitsCovered">&nbsp;966</td>
  <td class="src"><pre class="src">&nbsp;        afterWrite(operation, type, <span class="keyword">new</span> Serializable[] {idValue}, <span class="keyword">new</span> Object[] {object}, 1);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1718</td>
  <td class="nbHitsCovered">&nbsp;966</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1719</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1720</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/* (non-Javadoc)</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1721</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @see org.sakaiproject.genericdao.api.modifiers.BasicModifier#update(java.lang.Object)</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1722</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1723</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    <span class="keyword">public</span> <span class="keyword">void</span> update(Object object) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1724</td>
  <td class="nbHitsCovered">&nbsp;23</td>
  <td class="src"><pre class="src">&nbsp;        Class&lt;?&gt; type = findClass(object);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1725</td>
  <td class="nbHitsCovered">&nbsp;23</td>
  <td class="src"><pre class="src">&nbsp;        checkClass(type);</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1726</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1727</td>
  <td class="nbHitsCovered">&nbsp;23</td>
  <td class="src"><pre class="src">&nbsp;        Serializable idValue = baseGetIdValue(object);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1728</td>
  <td class="nbHitsCovered">&nbsp;23</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (idValue == <span class="keyword">null</span>) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1729</td>
  <td class="nbHitsCovered">&nbsp;5</td>
  <td class="src"><pre class="src">&nbsp;            <span class="keyword">throw</span> <span class="keyword">new</span> IllegalArgumentException(<span class="string">"Could not get an id value from the supplied object, cannot update without an id: "</span> + object);</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1730</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1731</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1732</td>
  <td class="nbHitsCovered">&nbsp;18</td>
  <td class="src"><pre class="src">&nbsp;        String operation = <span class="string">"update"</span>;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1733</td>
  <td class="nbHitsCovered">&nbsp;18</td>
  <td class="src"><pre class="src">&nbsp;        beforeWrite(operation, type, <span class="keyword">new</span> Serializable[] {idValue}, <span class="keyword">new</span> Object[] {object});</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1734</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1735</td>
  <td class="nbHitsCovered">&nbsp;18</td>
  <td class="src"><pre class="src">&nbsp;        baseUpdate(type, idValue, object);</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1736</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1737</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        <span class="comment">// clear the search caches</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1738</td>
  <td class="nbHitsCovered">&nbsp;18</td>
  <td class="src"><pre class="src">&nbsp;        getCacheProvider().clear(getSearchCacheName(type));</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1739</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        <span class="comment">// clear the cache entry since this was updated</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1740</td>
  <td class="nbHitsCovered">&nbsp;18</td>
  <td class="src"><pre class="src">&nbsp;        String key = idValue.toString();</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1741</td>
  <td class="nbHitsCovered">&nbsp;18</td>
  <td class="src"><pre class="src">&nbsp;        String cacheName = getCacheName(type);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1742</td>
  <td class="nbHitsCovered">&nbsp;18</td>
  <td class="src"><pre class="src">&nbsp;        getCacheProvider().remove(cacheName, key);</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1743</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1744</td>
  <td class="nbHitsCovered">&nbsp;18</td>
  <td class="src"><pre class="src">&nbsp;        afterWrite(operation, type, <span class="keyword">new</span> Serializable[] {idValue}, <span class="keyword">new</span> Object[] {object}, 1);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1745</td>
  <td class="nbHitsCovered">&nbsp;18</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1746</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1747</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/* (non-Javadoc)</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1748</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @see org.sakaiproject.genericdao.api.modifiers.BasicModifier#save(java.lang.Object)</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1749</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1750</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    <span class="keyword">public</span> <span class="keyword">void</span> save(Object object) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1751</td>
  <td class="nbHitsCovered">&nbsp;23</td>
  <td class="src"><pre class="src">&nbsp;        Serializable id = baseGetIdValue(object);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1752</td>
  <td class="nbHitsCovered">&nbsp;18</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (id == <span class="keyword">null</span>) {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1753</td>
  <td class="nbHitsCovered">&nbsp;9</td>
  <td class="src"><pre class="src">&nbsp;            create(object);</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1754</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        } <span class="keyword">else</span> {</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1755</td>
  <td class="nbHitsCovered">&nbsp;9</td>
  <td class="src"><pre class="src">&nbsp;            update(object);</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1756</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1757</td>
  <td class="nbHitsCovered">&nbsp;18</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1758</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1759</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/* (non-Javadoc)</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1760</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @see org.sakaiproject.genericdao.api.modifiers.BasicModifier#delete(java.lang.Object)</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1761</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1762</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    <span class="keyword">public</span> <span class="keyword">void</span> delete(Object object) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1763</td>
  <td class="nbHitsCovered">&nbsp;14</td>
  <td class="src"><pre class="src">&nbsp;        Class&lt;?&gt; type = findClass(object);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1764</td>
  <td class="nbHitsCovered">&nbsp;9</td>
  <td class="src"><pre class="src">&nbsp;        Serializable id = baseGetIdValue(object);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1765</td>
  <td class="nbHitsCovered">&nbsp;9</td>
  <td class="src"><pre class="src">&nbsp;        delete(type, id);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1766</td>
  <td class="nbHitsCovered">&nbsp;9</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1767</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1768</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/* (non-Javadoc)</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1769</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @see org.sakaiproject.genericdao.api.modifiers.BasicModifier#delete(java.lang.Class, java.io.Serializable)</span></pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1770</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1771</td>
  <td class="nbHitsUncovered">&nbsp;0</td>
  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    <span class="keyword">public</span> &lt;T&gt; <span class="keyword">boolean</span> delete(Class&lt;T&gt; type, Serializable id) {</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1772</td>
  <td class="nbHitsCovered">&nbsp;24</td>
  <td class="src"><pre class="src">&nbsp;        checkClass(type);</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1773</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1774</td>
  <td class="nbHitsCovered">&nbsp;24</td>
  <td class="src"><pre class="src">&nbsp;        String operation = <span class="string">"delete"</span>;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1775</td>
  <td class="nbHitsCovered">&nbsp;24</td>
  <td class="src"><pre class="src">&nbsp;        beforeWrite(operation, type, <span class="keyword">new</span> Serializable[] {id}, <span class="keyword">null</span>);</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1776</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1777</td>
  <td class="nbHitsCovered">&nbsp;24</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">boolean</span> removed = baseDelete(type, id);</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1778</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1779</td>
  <td class="nbHitsCovered">&nbsp;24</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (removed) {</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1780</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            <span class="comment">// clear the search caches</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1781</td>
  <td class="nbHitsCovered">&nbsp;18</td>
  <td class="src"><pre class="src">&nbsp;            getCacheProvider().clear(getSearchCacheName(type));</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1782</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            <span class="comment">// clear this from the cache</span></pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1783</td>
  <td class="nbHitsCovered">&nbsp;18</td>
  <td class="src"><pre class="src">&nbsp;            String key = id.toString();</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1784</td>
  <td class="nbHitsCovered">&nbsp;18</td>
  <td class="src"><pre class="src">&nbsp;            String cacheName = getCacheName(type);</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1785</td>
  <td class="nbHitsCovered">&nbsp;18</td>
  <td class="src"><pre class="src">&nbsp;            getCacheProvider().remove(cacheName, key);</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1786</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1787</td>
  <td class="nbHitsCovered">&nbsp;18</td>
  <td class="src"><pre class="src">&nbsp;            afterWrite(operation, type, <span class="keyword">new</span> Serializable[] {id}, <span class="keyword">null</span>, 1);</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1788</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td>
</tr>
<tr>
  <td class="numLineCover">&nbsp;1789</td>
  <td class="nbHitsCovered">&nbsp;24</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> removed;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1790</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1791</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td>
</tr>
<tr>
  <td class="numLine">&nbsp;1792</td>
  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;}</pre></td>
</tr>
</table>
<div class="footer">
Reports generated by <a href="http://cobertura.sourceforge.net/" target="_top">Cobertura</a>.
</div>
</body>
</html>
